Skip to content
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

feat: job system #12

Merged
merged 50 commits into from
Nov 22, 2024
Merged

feat: job system #12

merged 50 commits into from
Nov 22, 2024

Conversation

PeterBaker0
Copy link
Collaborator

@PeterBaker0 PeterBaker0 commented Nov 15, 2024

feat: job system

Description

Job system MVP including the following new components

  • additional DB models representing jobs, job assignments, job results and job types
  • jobs are defined as an input payload - results are through an assignment and can have files/result payload
  • a storage system which uses s3 - each job gets an assigned storage location (though technically right now it could write to anything in the bucket!) and is allowed to write to it - then the API endpoint can presign a map of relative file paths -> presigned URLs which the frontend can use to download code
  • CRUD type endpoints for interacting with job system including poll, list, get, assign, submit result etc
  • a prototype 'manager' service which runs as a 24/7 service polling the queue - it's job is to spin up nodes to consume the jobs from the queue
  • an example 'worker' service which is a proof of concept - later we can easily swap out this built CDK asset with a real image which consumes jobs - it provides a model for doing so
  • CDK code to deploy a storage bucket, ECS services, tasks etc
  • added a sequence diagram in README describing the interactions

TODOs later

  • validate long term behaviour by running a service which creates jobs every now and again overnight and make sure service is stable
  • better auto scaling management e.g. inspecting current number of containers rather than just using a cooldown period

Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
…municating with web API

Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Copy link

❌ Code formatting check failed. Please run npm run format:write locally and commit the changes.

Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Copy link

❌ Code formatting check failed. Please run npm run format:write locally and commit the changes.

Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Copy link

❌ Code formatting check failed. Please run npm run format:write locally and commit the changes.

Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Copy link

❌ Code formatting check failed. Please run npm run format:write locally and commit the changes.

Signed-off-by: Peter Baker <peter.baker122@csiro.au>
@PeterBaker0 PeterBaker0 removed the draft label Nov 17, 2024
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Copy link

❌ Code formatting check failed. Please run npm run format:write locally and commit the changes.

Signed-off-by: Peter Baker <peter.baker122@csiro.au>
…ts for the existing details/download routes.

Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Copy link

❌ Code formatting check failed. Please run npm run format:write locally and commit the changes.

Copy link
Contributor

@arlowhite arlowhite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

.vscode/settings.json Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/api/jobs/routes.ts Show resolved Hide resolved
src/api/services/jobs.ts Outdated Show resolved Hide resolved
src/api/services/jobs.ts Outdated Show resolved Hide resolved
src/infra/components/jobs.ts Outdated Show resolved Hide resolved
src/infra/components/reefGuideAPI.ts Outdated Show resolved Hide resolved
src/infra/infra.ts Outdated Show resolved Hide resolved
src/infra/lambda.ts Show resolved Hide resolved
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Copy link

❌ Code formatting check failed. Please run npm run format:write locally and commit the changes.

Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Copy link

❌ Code formatting check failed. Please run npm run format:write locally and commit the changes.

Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Copy link

❌ Code formatting check failed. Please run npm run format:write locally and commit the changes.

Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Copy link

❌ Code formatting check failed. Please run npm run format:write locally and commit the changes.

Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
@PeterBaker0 PeterBaker0 merged commit a399bb9 into main Nov 22, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants