Skip to content

feat!: create a session image from a code repository - #541

Merged
leafty merged 25 commits into
mainfrom
kpack-resources
Mar 6, 2025
Merged

leafty merged 25 commits into
mainfrom
kpack-resources

Conversation

@Panaetius
Panaetius force-pushed the kpack-resources branch 2 times, most recently from 7d0dacf to 29577cd Compare November 25, 2024 10:49
@Panaetius
Panaetius force-pushed the kpack-resources branch 5 times, most recently from 5f3ddf5 to 46ebfeb Compare December 2, 2024 08:40
@coveralls

coveralls commented Dec 2, 2024 •

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 13700760068

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 1777 of 2064 (86.09%) changed or added relevant lines in 20 files are covered.
  • 9 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.08%) to 86.456%

Changes Missing Coverage Covered Lines Changed/Added Lines %
components/renku_data_services/session/blueprints.py 48 49 97.96%
components/renku_data_services/notebooks/api/classes/k8s_client.py 4 6 66.67%
components/renku_data_services/session/models.py 82 84 97.62%
components/renku_data_services/session/orm.py 32 35 91.43%
components/renku_data_services/session/core.py 59 67 88.06%
components/renku_data_services/app_config/config.py 43 55 78.18%
components/renku_data_services/session/db.py 179 254 70.47%
components/renku_data_services/session/k8s_client.py 54 238 22.69%
Files with Coverage Reduction New Missed Lines %
components/renku_data_services/crc/models.py 1 82.04%
components/renku_data_services/session/db.py 2 80.27%
components/renku_data_services/notebooks/api/schemas/servers_get.py 6 68.31%
Totals Coverage Status
Change from base Build 13695771265: -0.08%
Covered Lines: 18173
Relevant Lines: 21020

💛 - Coveralls

@Panaetius
Panaetius force-pushed the kpack-resources branch 3 times, most recently from 7a754c1 to 8665a14 Compare December 2, 2024 09:22
@Panaetius
Panaetius force-pushed the kpack-resources branch 3 times, most recently from d9edcaf to ad17872 Compare December 10, 2024 13:09
@Panaetius Panaetius changed the title feat: add kpack k8s resources feat: custom environment build Dec 18, 2024
@leafty leafty changed the title feat: custom environment build feat!: custom environment build Feb 18, 2025
@Panaetius
Panaetius force-pushed the kpack-resources branch 2 times, most recently from 268e3ee to 55d2074 Compare February 24, 2025 11:04
@Panaetius
Panaetius force-pushed the kpack-resources branch 3 times, most recently from ffe8c9a to 115cd4c Compare March 5, 2025 09:13
@leafty
leafty force-pushed the kpack-resources branch from 115cd4c to e26a64a Compare March 5, 2025 09:44
@leafty leafty changed the title feat!: custom environment build feat!: create a session image from a code repository Mar 6, 2025
@leafty
leafty marked this pull request as ready for review March 6, 2025 08:02
Panaetius and others added 24 commits March 6, 2025 09:30
* refactor: implement k3d cluster creation working with kpack and Shipwright

The setup creates an independent k3d registry that can be
reused and configures the k3d cluster to be able to access
it.

The registry thus survives cluster deletion and this will
speed up cluster recreation.

kpack and Shipwrite can access it through http.

The script can install either or both solutions.

The Makefile installs Shipwright be default
* feat: use buildpacks with Shipwright

This PR implement a BuildStrategy that makes use of Paketo's
buildpacks to generate OCI images out of repositories.

The current strategy makes use of the full builder image so that
it supports a broader range of projects.

A test has been added to ensure the strategy works as expected.
Add the API for container image builds.
Important note: the code generator cannot be used for Tekton CRDs because this is what they use in the API spec:
```yaml
type: object
# One can use x-kubernetes-preserve-unknown-fields: true
# at the root of the schema (and inside any properties, additionalProperties)
# to get the traditional CRD behaviour that nothing is pruned, despite
# setting spec.preserveUnknownProperties: false.
#
# See https://kubernetes.io/blog/2019/06/20/crd-structural-schema/
# See issue: knative/serving#912
x-kubernetes-preserve-unknown-fields: true
```
In other words, there is no API spec!  (In openAPI format)
Support defining retention parameters for build runs.
* feat: allow configuring buildrun build timeout

* address comments
Add support for configuring node selector and tolerations for container image builds.

The node selector and tolerations are added to the Shipwright BuildRun object which in turn are added to the Pod running the image build.
Propagate the reason an image build failed by capturing the corresponding `condition.reason` from Shipwright.

Also, the build cancellation is now done properly.
Configure `renku-data-services` for session image builds based on the helm chart values.

* If `IMAGE_BUILDERS_ENABLED is True` then the new session environments and image builds are available.
* If `IMAGE_BUILDERS_ENABLED is False` then users do not have access to he new session environments and image builds.
  * The API will not validate `POST` or `PATCH` requests which configure image builds.
  * The API will not answer calls to the `/builds` endpoints.
* fix: reuse custom environment when patching session launcher
* feat: automatically start build when creating custom env from repo

@leafty leafty 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.

LGTM! 🎉

@leafty
leafty merged commit 60bd4e1 into main Mar 6, 2025
@leafty
leafty deleted the kpack-resources branch March 6, 2025 15:56
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.

7 participants