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/image builder api #614

Draft
wants to merge 22 commits into
base: kpack-resources
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e802870
add k8s cache client for shipwright buildruns
Panaetius Dec 10, 2024
22749bc
fix(linting): import order
SalimKayal Jan 21, 2025
2ffa0ae
feat(api): introduce endpoints for image builders
SalimKayal Jan 21, 2025
8d01b4c
feat(models): add model for image builders
SalimKayal Jan 21, 2025
8708ee5
fix(consistency): lowercase for StrEnums
SalimKayal Jan 22, 2025
dada2a8
fix(semantics): change EditorKind to FrontendKind
SalimKayal Jan 22, 2025
15d1041
fix(apispec): assume container_image is deterministic for image builders
SalimKayal Jan 22, 2025
35705e4
fix(apispec): branch to revision in image builders
SalimKayal Jan 22, 2025
651beed
fix(apispec): change required fields for image builders
SalimKayal Jan 22, 2025
3e945bf
Address (some) review comments
mohammad-alisafaee Jan 24, 2025
9cd24a9
fix after rebase
mohammad-alisafaee Jan 29, 2025
c96cfae
update
mohammad-alisafaee Jan 30, 2025
739f3a9
Change back EnvironmentKind enum to uppercase
mohammad-alisafaee Jan 30, 2025
35e86de
Address comments
mohammad-alisafaee Jan 30, 2025
127e5f0
Remove build_parameters endpoints
mohammad-alisafaee Jan 30, 2025
ce620e0
Update API
mohammad-alisafaee Jan 31, 2025
3f3adc9
Remove Revision and SubDir for now
mohammad-alisafaee Jan 31, 2025
c3f092e
Address review comments
mohammad-alisafaee Jan 31, 2025
24e8145
Address comments
mohammad-alisafaee Feb 3, 2025
05a69b1
Address comments
mohammad-alisafaee Feb 3, 2025
b5cbfc2
Address comments
mohammad-alisafaee Feb 3, 2025
622accd
Update API
mohammad-alisafaee Feb 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ async def get_server(self, name: str, safe_username: str) -> _SessionType | None

If the request to the cache fails, fallback to the k8s API.
"""
server = None
try:
server = await self.cache.get_server(name)
except CacheError:
Expand Down
126 changes: 97 additions & 29 deletions components/renku_data_services/session/api.spec.yaml
leafty marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ components:
$ref: "#/components/schemas/Description"
container_image:
$ref: "#/components/schemas/ContainerImage"
build_parameter:
$ref: "#/components/schemas/BuildParameter"
environment_image_source:
$ref: "#/components/schemas/EnvironmentImageSource"
mohammad-alisafaee marked this conversation as resolved.
Show resolved Hide resolved
default_url:
$ref: "#/components/schemas/DefaultUrl"
uid:
Expand Down Expand Up @@ -301,19 +305,7 @@ components:
- uid
- gid
- default_url
example:
id: 01AN4Z79ZS6XX96588FDX0H099
name: JupyterLab environment
creation_date: "2023-11-01T17:32:28Z"
description: JupyterLab session environment
container_image: renku-jupyter:latest
default_url: "/lab"
port: 8080
working_directory: /home/jovyan/work
mount_directory: /home/jovyan/work
uid: 1000
gid: 1000
is_archive: false
- environment_image_source
EnvironmentGetInLauncher:
allOf:
- $ref: "#/components/schemas/Environment"
Expand All @@ -323,19 +315,10 @@ components:
$ref: "#/components/schemas/EnvironmentKind"
required:
- environment_kind
example:
environment_kind: global_environment
EnvironmentPostInLauncher:
allOf:
oneOf:
- $ref: "#/components/schemas/EnvironmentPost"
- type: object
properties:
environment_kind:
$ref: "#/components/schemas/EnvironmentKind"
required:
- environment_kind
example:
environment_kind: global_environment
- $ref: "#/components/schemas/BuildParameterPost"
EnvironmentPost:
description: Data required to create a session environment
type: object
Expand Down Expand Up @@ -377,9 +360,15 @@ components:
is_archived:
$ref: "#/components/schemas/IsArchived"
default: false
environment_image_source:
description: Source of the environment
type: string
enum:
- image
required:
- name
- container_image
- environment_image_source
EnvironmentPatchInLauncher:
allOf:
- $ref: "#/components/schemas/EnvironmentPatch"
Expand Down Expand Up @@ -416,6 +405,10 @@ components:
$ref: "#/components/schemas/EnvironmentArgs"
is_archived:
$ref: "#/components/schemas/IsArchived"
build_parameter:
$ref: "#/components/schemas/BuildParameter"
environment_image_source:
$ref: "#/components/schemas/EnvironmentImageSource"
mohammad-alisafaee marked this conversation as resolved.
Show resolved Hide resolved
SessionLaunchersList:
description: A list of Renku session launchers
type: array
Expand Down Expand Up @@ -506,6 +499,19 @@ components:
minLength: 1
maxLength: 99
example: My Renku Session :)
BuilderVariant:
description: Type of virtual environment manager when building custom environments.
type: string
enum:
- conda
- pip
FrontendVariant:
description: User's Frontend Choice.
type: string
enum:
- vscodium
- jupyterlab
- streamlit
EnvironmentIdOnlyPatch:
type: object
properties:
Expand All @@ -519,12 +525,17 @@ components:
required:
- id
EnvironmentKind:
description: Kind of environment to use
description: Kind of the environment
type: string
enum:
- global
- custom
EnvironmentImageSource:
description: Source of the environment's image
type: string
enum:
- GLOBAL
- CUSTOM
example: CUSTOM
- image
- build
EnvironmentId:
description: Id of the environment to use
type: string
Expand All @@ -539,6 +550,48 @@ components:
description: A description for the resource
type: string
maxLength: 500
BuildParameter:
mohammad-alisafaee marked this conversation as resolved.
Show resolved Hide resolved
description: A build parameter
type: object
additionalProperties: false
properties:
repository:
$ref: "#/components/schemas/Repository"
revision:
$ref: "#/components/schemas/Revision"
subdir:
$ref: "#/components/schemas/SubDir"
builder_variant:
$ref: "#/components/schemas/BuilderVariant"
frontend_variant:
$ref: "#/components/schemas/FrontendVariant"
required:
- repository
- builder_variant
- frontend_variant
BuildParameterPost:
mohammad-alisafaee marked this conversation as resolved.
Show resolved Hide resolved
description: Data required to create a build parameter
type: object
properties:
repository:
$ref: "#/components/schemas/Repository"
revision:
$ref: "#/components/schemas/Revision"
subdir:
$ref: "#/components/schemas/SubDir"
builder_variant:
$ref: "#/components/schemas/BuilderVariant"
frontend_variant:
$ref: "#/components/schemas/FrontendVariant"
environment_image_source:
type: string
enum:
- build
required:
- repository
- builder_variant
- frontend_variant
- environment_image_source
ContainerImage:
description: A container image
type: string
Expand All @@ -547,6 +600,19 @@ components:
# based on https://github.com/opencontainers/distribution-spec/blob/main/spec.md
pattern: "^[a-z0-9]+((\\.|_|__|-+)[a-z0-9]+)*(\\/[a-z0-9]+((\\.|_|__|-+)[a-z0-9]+)*)*(:[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}|@sha256:[a-fA-F0-9]{64}){0,1}$"
example: renku/renkulab-py:3.10-0.18.1
Repository:
description: The repository used as a basis for a custom builder
type: string
maxLength: 500
example: "https://github.com/voila-gallery/gaussian-density"
Revision:
description: The revision of the repository used as a basis for a custom builder
SalimKayal marked this conversation as resolved.
Show resolved Hide resolved
type: string
maxLength: 100
SubDir:
description: The sub directory of the repository used as a basis for a custom builder
type: string
minLength: 1
DefaultUrl:
description: The default path to open in a session
type: string
Expand Down Expand Up @@ -596,7 +662,9 @@ components:
example: "/home/jovyan/work"
EnvironmentMountDirectory:
type: string
description: The location where the persistent storage for the session will be mounted, usually it should be identical to or a parent of the working directory, if left unset will default to the working directory.
description:
The location where the persistent storage for the session will be mounted, usually it should be identical to or
a parent of the working directory, if left unset will default to the working directory.
minLength: 1
example: "/home/jovyan/work"
EnvironmentMountDirectoryPatch:
Expand Down
Loading
Loading