From c0fe595b5f2f0a314bf75dfcb62b01400dd6e7b0 Mon Sep 17 00:00:00 2001 From: Johannes Faltermeier Date: Mon, 22 May 2023 12:48:26 +0200 Subject: [PATCH] Add new API to Service #69 * Extend public API * add verification job for new docker image --- .github/workflows/docker-git-init.yml | 18 ++++++++++++++++++ node/common/package.json | 2 +- node/common/src/client.ts | 12 +++++++----- terraform/terraform.md | 4 ++-- 4 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/docker-git-init.yml diff --git a/.github/workflows/docker-git-init.yml b/.github/workflows/docker-git-init.yml new file mode 100644 index 00000000..27c43677 --- /dev/null +++ b/.github/workflows/docker-git-init.yml @@ -0,0 +1,18 @@ +name: Docker Git Init CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build -t theia-cloud-git-init:$(date +%s) -f dockerfiles/git-init/Dockerfile . diff --git a/node/common/package.json b/node/common/package.json index d086f0dd..9b42d550 100644 --- a/node/common/package.json +++ b/node/common/package.json @@ -1,6 +1,6 @@ { "name": "@eclipse-theiacloud/common", - "version": "0.8.0-alpha.23", + "version": "0.8.0-alpha.24", "description": "Common functionality for Theia.cloud", "license": "EPL-2.0", "keywords": [ diff --git a/node/common/src/client.ts b/node/common/src/client.ts index b7ee7131..3c46d027 100644 --- a/node/common/src/client.ts +++ b/node/common/src/client.ts @@ -2,7 +2,7 @@ import { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios'; import { v4 as uuidv4 } from 'uuid'; import { - LaunchRequest as ClientLaunchRequest, + GitInit as ClientGitInit, LaunchRequest as ClientLaunchRequest, PingRequest as ClientPingRequest, RootResourceApi, SessionActivityRequest as ClientSessionActivityRequest, SessionListRequest as ClientSessionListRequest, SessionPerformance, SessionPerformanceRequest as ClientSessionPerformanceRequest, SessionResourceApi, SessionSpec, SessionStartRequest as ClientSessionStartRequest, SessionStopRequest as ClientSessionStopRequest, @@ -49,13 +49,13 @@ export namespace LaunchRequest { } export function createWorkspace(serviceUrl: string, appId: string, appDefinition: string, timeout?: number, user: string = createUser(), - workspaceName?: string, label?: string): LaunchRequest { - return { serviceUrl, appId, appDefinition, user, label, workspaceName, ephemeral: false, timeout }; + workspaceName?: string, label?: string, gitInit?: GitInit): LaunchRequest { + return { serviceUrl, appId, appDefinition, user, label, workspaceName, ephemeral: false, timeout, gitInit }; } // eslint-disable-next-line max-len - export function existingWorkspace(serviceUrl: string, appId: string, workspaceName: string, timeout?: number, appDefinition?: string, user: string = createUser()): LaunchRequest { - return { serviceUrl, appId, workspaceName, appDefinition, user, timeout }; + export function existingWorkspace(serviceUrl: string, appId: string, workspaceName: string, timeout?: number, appDefinition?: string, user: string = createUser(), gitInit?: GitInit): LaunchRequest { + return { serviceUrl, appId, workspaceName, appDefinition, user, timeout, gitInit }; } } @@ -99,6 +99,8 @@ export namespace WorkspaceDeletionRequest { export const KIND = 'workspaceDeletionRequest'; } +export type GitInit = ClientGitInit; + export namespace TheiaCloud { function rootApi(serviceUrl: string, accessToken: string | undefined): RootResourceApi { return new RootResourceApi(new Configuration({ basePath: serviceUrl, accessToken })); diff --git a/terraform/terraform.md b/terraform/terraform.md index 48c33a52..9bf20521 100644 --- a/terraform/terraform.md +++ b/terraform/terraform.md @@ -66,8 +66,8 @@ You might have to configure the firewall for mounting. ```bash # This mounts the ~/tmp/minikube on the machine running minikube into minkube. -# Check the persisted volume to find the exact /tmp/hostpath-provisioner/theia-cloud/id path -minikube mount ~/tmp/minikube:/tmp/hostpath-provisioner/theia-cloud/a36c30cee-4d97-4097-826a-31ba72734fd0-pvc-ws-asdfghjkl-theia-c/ +# Check the persisted volume to find the exact /tmp/hostpath-provisioner/theia-cloud/ path +minikube mount --uid 101 --gid 101 ~/tmp/minikube:/tmp/hostpath-provisioner/theia-cloud ``` #### Destroy Minikube Cluster