Skip to content

Commit

Permalink
Add new API to Service #69
Browse files Browse the repository at this point in the history
* Extend public API
* add verification job for new docker image
  • Loading branch information
jfaltermeier committed May 22, 2023
1 parent 62d4351 commit c0fe595
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/docker-git-init.yml
Original file line number Diff line number Diff line change
@@ -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 .
2 changes: 1 addition & 1 deletion node/common/package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
12 changes: 7 additions & 5 deletions node/common/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 };
}
}

Expand Down Expand Up @@ -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 }));
Expand Down
4 changes: 2 additions & 2 deletions terraform/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c0fe595

Please sign in to comment.