Skip to content

feat: add API for container image builds - #625

Merged
leafty merged 44 commits into
kpack-resourcesfrom
leafty/session-builds-api
Feb 24, 2025
Merged

leafty merged 44 commits into
kpack-resourcesfrom
leafty/session-builds-api

Conversation

@leafty

@leafty leafty commented Jan 31, 2025 •

Copy link
Copy Markdown
Member

Add the API for container image builds.

PR Stack:

Notes:

  • The BuildLogs object can be adjusted to reflect which logs we can get
  • The Build type is not generated, but is equal to Build2 | Build3 (I guess the type tree get canonicalized with a union at the top and the code generator does not give a name for those).

Implemented:

  • POST /builds
  • GET /builds/<build_id:ulid>
  • PATCH /builds/<build_id:ulid> (Note: the only action allowed here is to cancel a build)
  • GET /environments/<environment_id:ulid>/builds

TODO:

  • Move constants to constants.py
  • Use real environment instances -> re-create the db migration too
  • Use authz for Read/Write permissions
  • Move ShipWright logic out of db.py into shipwright_core.py
  • More tests
  • Can we do tests against k8s in the dev container?
  • Update the k8s role for data services (feat!: create a session image from a code repository renku#3878, SwissDataScienceCenter/renku@cce99ae):
    - apiGroups:
         - shipwright.io
       resources:
         - buildruns
       verbs:
         - create
         - update
         - delete
         - patch
         - list
         - get
         - watch
    
  • Create the k8s secret to push docker images to harbor
    Done manually for now:
    kubectl -n renku-ci-ds-625 create secret docker-registry flora-docker-secret \
      --docker-server="harbor.dev.renku.ch" \
      --docker-username="flora" \
      --docker-password="<PASSWORD>"
    
  • Create the BuildStrategy
    Done manually for now:
    kubectl -n renku-ci-ds-625 apply -f <buildstrategy.yaml>
    

/deploy #notest renku=build/session-env-builders renku-ui=leafty/session-env-builders-1 extra-values=dataService.imageBuilders.enabled=true,dataService.imageBuilders.outputImagePrefix=harbor.dev.renku.ch/flora-dev/,dataService.imageBuilders.pushSecretName=flora-docker-secret

@RenkuBot

RenkuBot commented Feb 7, 2025

Copy link
Copy Markdown
Contributor

@leafty
leafty force-pushed the leafty/session-builds-api branch from bc3a8c7 to c5bf8b2 Compare February 7, 2025 14:42
@leafty
leafty temporarily deployed to renku-ci-ds-625 February 7, 2025 16:36 — with GitHub Actions Inactive
@leafty
leafty temporarily deployed to renku-ci-ds-625 February 7, 2025 17:15 — with GitHub Actions Inactive
@leafty
leafty temporarily deployed to renku-ci-ds-625 February 10, 2025 07:28 — with GitHub Actions Inactive
@leafty
leafty temporarily deployed to renku-ci-ds-625 February 10, 2025 07:53 — with GitHub Actions Inactive
@leafty
leafty temporarily deployed to renku-ci-ds-625 February 10, 2025 08:04 — with GitHub Actions Inactive
@leafty
leafty temporarily deployed to renku-ci-ds-625 February 10, 2025 08:25 — with GitHub Actions Inactive
@leafty
leafty temporarily deployed to renku-ci-ds-625 February 10, 2025 08:44 — with GitHub Actions Inactive
@leafty
leafty temporarily deployed to renku-ci-ds-625 February 10, 2025 10:52 — with GitHub Actions Inactive
@leafty
leafty temporarily deployed to renku-ci-ds-625 February 10, 2025 10:57 — with GitHub Actions Inactive
@leafty
leafty temporarily deployed to renku-ci-ds-625 February 10, 2025 12:10 — with GitHub Actions Inactive
@leafty
leafty temporarily deployed to renku-ci-ds-625 February 10, 2025 15:30 — with GitHub Actions Inactive
@leafty
leafty temporarily deployed to renku-ci-ds-625 February 10, 2025 15:53 — with GitHub Actions Inactive
@leafty
leafty temporarily deployed to renku-ci-ds-625 February 10, 2025 16:08 — with GitHub Actions Inactive
@leafty
leafty temporarily deployed to renku-ci-ds-625 February 11, 2025 07:40 — with GitHub Actions Inactive
@leafty
leafty temporarily deployed to renku-ci-ds-625 February 11, 2025 08:20 — with GitHub Actions Inactive
@leafty
leafty force-pushed the leafty/session-builds-api branch from 3827fc9 to 722594c Compare February 19, 2025 09:51
@leafty
leafty temporarily deployed to renku-ci-ds-625 February 19, 2025 09:51 — with GitHub Actions Inactive

@olevski olevski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks Flora! A few comments and suggestions.

@RenkuBot

Copy link
Copy Markdown
Contributor

Tearing down the temporary RenkuLab deplyoment for this PR.

This branch was successfully deployed

1 active deployment
renku-ci-ds-625 — b22a6a2a Deployed Feb 24, 2025 by leafty
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.

3 participants