notebooks/workspaces/backend
Mohamed Akrem Chabchoub d06762d4ad
fix(ws): update JSON payload for listing workspaces (#134)
* fix(ws): update JSON payload for listing workspaces

Signed-off-by: mohamedch7 <121046693+mohamedch7@users.noreply.github.com>

* fix(ws): fix workspaceKind type to POD_TEMPLATE

Signed-off-by: mohamedch7 <121046693+mohamedch7@users.noreply.github.com>

* fix(ws): ensure podMetadata labels/annotations are not null

Signed-off-by: mohamedch7 <121046693+mohamedch7@users.noreply.github.com>

* fix(ws): fetch and use WorkspaceKind for determining home mount paths

Signed-off-by: mohamedch7 <121046693+mohamedch7@users.noreply.github.com>

* fix(ws): fix Volumes.Home values and tests

Signed-off-by: mohamedch7 <121046693+mohamedch7@users.noreply.github.com>

* fix(ws): fix PodConfig desired value

Signed-off-by: mohamedch7 <121046693+mohamedch7@users.noreply.github.com>

* chore: remove lint warnings by cleaning up comments and formatting

Signed-off-by: mohamedch7 <121046693+mohamedch7@users.noreply.github.com>

* fix(ws): refactor workspace model creation to include WorkspaceKind

Signed-off-by: mohamedch7 <121046693+mohamedch7@users.noreply.github.com>

* fix(ws): Move NewWorkspaceModelFromWorkspace from models to repositories

Signed-off-by: mohamedch7 <121046693+mohamedch7@users.noreply.github.com>

---------

Signed-off-by: mohamedch7 <121046693+mohamedch7@users.noreply.github.com>
2025-01-24 21:43:21 +00:00
..
api fix(ws): update JSON payload for listing workspaces (#134) 2025-01-24 21:43:21 +00:00
cmd Notebooks 2.0 // Backend // List Workspaces API (#60) 2024-09-23 21:54:32 +00:00
internal fix(ws): update JSON payload for listing workspaces (#134) 2025-01-24 21:43:21 +00:00
.dockerignore feat(ws): add kubernetes client to backend (#15) 2024-06-08 19:25:05 +00:00
.gitignore chore: update go linting + update dependencies for controller (#137) 2024-12-02 16:56:58 +00:00
.golangci.yml chore: update go linting + update dependencies for controller (#137) 2024-12-02 16:56:58 +00:00
Dockerfile chore: update go linting + update dependencies for controller (#137) 2024-12-02 16:56:58 +00:00
Makefile chore: update go linting + update dependencies for controller (#137) 2024-12-02 16:56:58 +00:00
README.md feat(ws): Notebooks 2.0 // Backend // List namespaces (#124) 2024-11-28 00:06:54 +00:00
go.mod chore: update go linting + update dependencies for controller (#137) 2024-12-02 16:56:58 +00:00
go.sum chore: update go linting + update dependencies for controller (#137) 2024-12-02 16:56:58 +00:00

README.md

Kubeflow Workspaces Backend

The Kubeflow Workspaces Backend is the backend for frontend (BFF) used by the Kubeflow Workspaces Frontend as part of Kubeflow Notebooks 2.0.

⚠️ Warning ⚠️

The Kubeflow Workspaces Backend is a work in progress and is NOT currently ready for use. We greatly appreciate any contributions.

Building and Deploying

TBD

Development

Run the following command to build the BFF:

make build

After building it, you can run our app with:

make run

If you want to use a different port:

make run PORT=8000 

Endpoints

URL Pattern Handler Action
GET /api/v1/healthcheck healthcheck_handler Show application information
GET /api/v1/namespaces namespaces_handler Get all Namespaces
GET /api/v1/workspaces workspaces_handler Get all Workspaces
GET /api/v1/workspaces/{namespace} workspaces_handler Get all Workspaces from a namespace
POST /api/v1/workspaces/{namespace} workspaces_handler Create a Workspace in a given namespace
GET /api/v1/workspaces/{namespace}/{name} workspaces_handler Get a Workspace entity
PATCH /api/v1/workspaces/{namespace}/{name} TBD Patch a Workspace entity
PUT /api/v1/workspaces/{namespace}/{name} TBD Update a Workspace entity
DELETE /api/v1/workspaces/{namespace}/{name} workspaces_handler Delete a Workspace entity
GET /api/v1/workspacekinds workspacekinds_handler Get all WorkspaceKind
POST /api/v1/workspacekinds TBD Create a WorkspaceKind
GET /api/v1/workspacekinds/{name} workspacekinds_handler Get a WorkspaceKind entity
PATCH /api/v1/workspacekinds/{name} TBD Patch a WorkspaceKind entity
PUT /api/v1/workspacekinds/{name} TBD Update a WorkspaceKind entity
DELETE /api/v1/workspacekinds/{name} TBD Delete a WorkspaceKind entity

Sample local calls

# GET /api/v1/healthcheck
curl -i localhost:4000/api/v1/healthcheck
# GET /api/v1/namespaces
curl -i localhost:4000/api/v1/namespaces
# GET /api/v1/workspaces/
curl -i localhost:4000/api/v1/workspaces
# GET /api/v1/workspaces/{namespace}
curl -i localhost:4000/api/v1/workspaces/default
# POST /api/v1/workspaces/{namespace}
curl -X POST http://localhost:4000/api/v1/workspaces/default \
    -H "Content-Type: application/json" \
    -d '{
        "name": "dora",
        "paused": false,
        "defer_updates": false,
        "kind": "jupyterlab",
        "image_config": "jupyterlab_scipy_190",
        "pod_config": "tiny_cpu",
        "home_volume": "workspace-home-bella",
        "data_volumes": [
            {
                "pvc_name": "workspace-data-bella",
                "mount_path": "/data/my-data",
                "read_only": false
            }
        ]
    }'
# GET /api/v1/workspaces/{namespace}/{name}
curl -i localhost:4000/api/v1/workspaces/default/dora
# DELETE /api/v1/workspaces/{namespace}/{name}
curl -X DELETE localhost:4000/api/v1/workspaces/workspace-test/dora
# GET /api/v1/workspacekinds
curl -i localhost:4000/api/v1/workspacekinds
# GET /api/v1/workspacekinds/{name}
curl -i localhost:4000/api/v1/workspacekinds/jupyterlab