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

Draft: Backend implementation for server-side image builds #131

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

AdrianoKF
Copy link
Collaborator

@AdrianoKF AdrianoKF commented Oct 18, 2024

This PR adds a prototype for the backend API for server-side image builds.

Usage:

# Put together build context (in client/)
client/$ tar --exclude-from=../.gitignore -czf context.tgz .

# Submit the build request
client/$ curl -X 'POST' \
  'http://localhost:8000/builds/build' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -F 'image_spec=@examples/example-hello.yaml;type=application/x-yaml' \
  -F '[email protected];type=application/x-gzip' \
  -F 'name=test-image' \
  -F 'tag=latest' \
  -F 'platform=linux/amd64'

See issue #43

Copy link

codecov bot commented Oct 18, 2024

Codecov Report

Attention: Patch coverage is 45.41063% with 226 lines in your changes missing coverage. Please review.

Project coverage is 55.28%. Comparing base (abdc993) to head (4ab26c2).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ckend/src/jobq_server/utils/assembler/renderers.py 40.42% 112 Missing ⚠️
backend/src/jobq_server/utils/assembler/config.py 54.36% 47 Missing ⚠️
backend/src/jobq_server/routers/builds.py 51.28% 38 Missing ⚠️
backend/src/jobq_server/utils/processes.py 29.26% 29 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #131      +/-   ##
==========================================
- Coverage   56.60%   55.28%   -1.33%     
==========================================
  Files          62       67       +5     
  Lines        3132     3545     +413     
==========================================
+ Hits         1773     1960     +187     
- Misses       1359     1585     +226     
Flag Coverage Δ
backend 71.26% <45.41%> (-17.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

build_jobs: dict[str, dict] = {}


class BuildJobStatus(str, Enum): # noqa: UP042
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could use StrEnum instead of Str, Enum server side, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't see this code ending up in the real implementation, but in principle yes :)

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