-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement API step executor #38
Conversation
type PipelineModel struct { | ||
Uuid primitive.ObjectID `bson:"_id,omitempty" json:"uuid,omitempty"` // unique id for the pipeline | ||
PipelineName string `bson:"pipeline_name" json:"pipeline_name"` | ||
PipelineId string `bson:"pipeline_id" json:"pipeline_id"` // id for the pipeline. non-unique and uses `Version` to differentiate between different versions of the pipeline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this means different versions of the pipeline will have the same ID and different uuid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, the admin might create a pipeline called "Create EC2"
the first version will be uuid=1, pipelineId=1, pipelineName=createEC2, version=1
then he updates the pipeline by changing the URL.
so the 2nd version will be uuid=2, pipelineId=1, pipelineName=createEC2, version=2
Updates
I've made the following changes:
PipelineUuid
-->PipelineId
- Old
PipelineId
removed in favour ofPrevVersionId
This way, we can still aggregate pipelines that are of the same ancestry together without the naming confusion.
LastUpdated time.Time `bson:"last_updated"` | ||
Remarks string `bson:"remarks"` | ||
Id primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` | ||
PipelineUuid string `bson:"pipeline_uuid" json:"pipeline_uuid"` // should we use primitive.ObjectID here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think string is fine since UUID can have hyphens in it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tbh, it's not really a UUID. According to the documents, the mongo ObjectID is just a '24 character hexadecimal value'.
I'm just calling it UUID cause I don't want to call it pipelineId in the service request model as it will be confused with the actual pipelineId in the pipeline model.
Maybe I'll change this
Updates
see #38 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Took note of the models too, thanks. Do make sure that the event listener for NewServiceRequest
can handle multiple events asynchronously. Maybe can write some test cases to ensure its working properly.
PipelineId is different from PipelineUuid. Uuid refers to the unique identifier for each record in the database. Id refers to a uniqe pipeline that may have multiple versions.
05d5178
to
491743b
Compare
replaced PipelineUuid with PipelineId old PipelineId has been removed in favour of PrevVersionId
d724a4c
to
9130695
Compare
Description
Pipeline Execution
I created a basic pipeline executor. The flow is like this:
NewServiceRequestEvent
(see https://github.com/gookit/event)StepExecutionManager
listens forNewServiceRequestEvent
and begins working on the requestThe logic of executing the request steps is as follows:
StepExecutionManager
. Registration is done via theWithExecutor
method (see Golang options design pattern). The parameters submitted via the user when creating a new service request is passed in viacontext.Context
. We will use the same method to pass intermediate results between steps in the futureSeeding
I've also added seeding for the pipeline.
Miscellaneous
json
embedding previously. Not too sure how you were creating new service requests without this embedding.fe
andbe
profiles for docker so that it's easier to run backend only without building the frontend.docker compose --profile be -p flowforge up --build
--> for running backend onlydocker compose --profile be-seed -p flowforge up --build
--> for seeding the databaseFuture TODOs:
logger
using options design pattern