Skip to content
Snippets Groups Projects
Verified Commit 96df9598 authored by Daniel Göbel's avatar Daniel Göbel
Browse files

Migrate t new service architecture of CloWM

#32
parent 9aabe703
No related branches found
No related tags found
2 merge requests!84Remove development branch,!27Resolve "Migrate to new service architecture"
Showing
with 1885 additions and 1789 deletions
...@@ -6,10 +6,14 @@ cache: ...@@ -6,10 +6,14 @@ cache:
stages: stages:
- test - test
- build - build
- deploy
before_script: default:
- npm --version # For debugging tags:
- npm install - docker
before_script:
- npm --version # For debugging
- npm install
lint: lint:
stage: test stage: test
...@@ -24,3 +28,38 @@ build: ...@@ -24,3 +28,38 @@ build:
artifacts: artifacts:
paths: paths:
- dist - dist
build-publish-dev-docker-container-job:
stage: deploy
image:
name: gcr.io/kaniko-project/executor:v1.9.1-debug
entrypoint: [""]
only:
refs:
- development
before_script:
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"},\"$CI_DEPENDENCY_PROXY_SERVER\":{\"auth\":\"$(printf "%s:%s" ${CI_DEPENDENCY_PROXY_USER} "${CI_DEPENDENCY_PROXY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
script:
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}:dev-${CI_COMMIT_SHA}"
--destination "${CI_REGISTRY_IMAGE}:dev-latest"
build-publish-docker-container-job:
stage: deploy
image:
name: gcr.io/kaniko-project/executor:v1.9.1-debug
entrypoint: [""]
only:
- tags
before_script:
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"},\"$CI_DEPENDENCY_PROXY_SERVER\":{\"auth\":\"$(printf "%s:%s" ${CI_DEPENDENCY_PROXY_USER} "${CI_DEPENDENCY_PROXY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
script:
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
--destination "${CI_REGISTRY_IMAGE}:$(echo ${CI_COMMIT_TAG} | cut -d'.' -f1-2)"
--destination "${CI_REGISTRY_IMAGE}:$(echo ${CI_COMMIT_TAG} | cut -d'.' -f1)"
--destination "${CI_REGISTRY_IMAGE}:latest"
...@@ -10,7 +10,9 @@ npm install ...@@ -10,7 +10,9 @@ npm install
This has to be done only once. Export the environment variables with the appropriate values and use the `envsubst` command This has to be done only once. Export the environment variables with the appropriate values and use the `envsubst` command
to populate the template and create the file the `public/env.js` to populate the template and create the file the `public/env.js`
```shell ```shell
export API_BASE_URL=http://localhost:9999/api export AUTH_API_BASE_URL=http://localhost:9999/api/auth-service
export WORKFLOW_API_BASE_URL=http://localhost:9999/api/workflow-service
export S3PROXY_API_BASE_URL=http://localhost:9999/api/s3proxy-service
export S3_URL=http://localhost:9998 export S3_URL=http://localhost:9998
envsubst < src/assets/env.template.js > public/env.js envsubst < src/assets/env.template.js > public/env.js
``` ```
......
# ProxyAPI-UI # CloWM-UI
## Description ## Description
This is the Frontend to manage your S3 Buckets and start Workflows. For further information visit the repository for the This is the Frontend to manage your S3 Buckets and start Workflows.
backend https://gitlab.ub.uni-bielefeld.de/denbi/object-storage-access
## Environment Variables ## Environment Variables
...@@ -11,12 +10,9 @@ The docker container replaces them in the `env.template.js` file and moves that ...@@ -11,12 +10,9 @@ The docker container replaces them in the `env.template.js` file and moves that
When accessing the website, these variables will be loaded dynamically into the application. When accessing the website, these variables will be loaded dynamically into the application.
| Variable | Default | Value | Description | | Variable | Default | Value | Description |
|-----------------|---------|-----------|----------------------------------------| |-------------------------|---------|-----------|----------------------------------------|
| `API_BASE_URL` | unset | HTTP URL | Base URL for the API as backend | | `AUTH_API_BASE_URL` | unset | HTTP URL | Base URL for the Auth Service API |
| `S3_URL` | unset | HTTP URL | URL of the S3 storage to interact with | | `WORKFLOW_API_BASE_URL` | unset | HTTP URL | Base URL for the Workflow Service API |
| `S3PROXY_API_BASE_URL` | unset | HTTP URL | Base URL for the S3Proxy Service API |
## Getting started | `S3_URL` | unset | HTTP URL | URL of the S3 storage to interact with |
This service depends on multiple other services. See [DEVELOPING.md](DEVELOPING.md) how to set these up for developing
on your local machine.
This diff is collapsed.
{ {
"name": "proxyapi-ui", "name": "clowm-ui",
"version": "1.0.1", "version": "2.0.0",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "run-p type-check build-only", "build": "run-p type-check build-only",
...@@ -8,19 +8,21 @@ ...@@ -8,19 +8,21 @@
"build-only": "vite build", "build-only": "vite build",
"type-check": "vue-tsc --noEmit", "type-check": "vue-tsc --noEmit",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"generate-client": "openapi --input http://localhost:9999/api/openapi.json --output src/client --client axios" "generate-s3-client": "openapi --input https://clowm-staging.bi.denbi.de/api/s3proxy-service/openapi.json --output src/client/s3proxy --client axios",
"generate-auth-client": "openapi --input https://clowm-staging.bi.denbi.de/api/auth-service/openapi.json --output src/client/auth --client axios",
"generate-workflow-client": "openapi --input https://clowm-staging.bi.denbi.de/api/workflow-service/openapi.json --output src/client/workflow --client axios"
}, },
"dependencies": { "dependencies": {
"@aws-sdk/client-s3": "^3.238.0", "@aws-sdk/client-s3": "^3.281.0",
"@aws-sdk/s3-request-presigner": "^3.238.0", "@aws-sdk/s3-request-presigner": "^3.281.0",
"@aws-sdk/lib-storage": "^3.238.0", "@aws-sdk/lib-storage": "^3.281.0",
"@popperjs/core": "^2.11.6", "@popperjs/core": "^2.11.6",
"bootstrap": "^5.2.3", "bootstrap": "^5.2.3",
"bootstrap-icons": "^1.10.3", "bootstrap-icons": "^1.10.3",
"dayjs": "^1.11.7", "dayjs": "^1.11.7",
"filesize": "^10.0.6", "filesize": "^10.0.6",
"pinia": "^2.0.28", "pinia": "^2.0.32",
"vue": "^3.2.45", "vue": "^3.2.47",
"vue-router": "^4.1.6", "vue-router": "^4.1.6",
"vue3-cookies": "^1.0.6" "vue3-cookies": "^1.0.6"
}, },
...@@ -34,12 +36,12 @@ ...@@ -34,12 +36,12 @@
"@vue/eslint-config-prettier": "^7.0.0", "@vue/eslint-config-prettier": "^7.0.0",
"@vue/eslint-config-typescript": "^11.0.2", "@vue/eslint-config-typescript": "^11.0.2",
"@vue/tsconfig": "^0.1.3", "@vue/tsconfig": "^0.1.3",
"axios": "^1.2.1", "axios": "^1.3.4",
"eslint": "^8.28.0", "eslint": "^8.28.0",
"eslint-plugin-vue": "^9.7.0", "eslint-plugin-vue": "^9.7.0",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"openapi-typescript-codegen": "^0.23.0", "openapi-typescript-codegen": "^0.23.0",
"prettier": "^2.8.1", "prettier": "^2.8.4",
"rollup-plugin-node-polyfills": "^0.2.1", "rollup-plugin-node-polyfills": "^0.2.1",
"sass": "^1.56.1", "sass": "^1.56.1",
"typescript": "~4.7.4", "typescript": "~4.7.4",
......
...@@ -4,7 +4,9 @@ import { onBeforeMount } from "vue"; ...@@ -4,7 +4,9 @@ import { onBeforeMount } from "vue";
import { useCookies } from "vue3-cookies"; import { useCookies } from "vue3-cookies";
import { useAuthStore } from "@/stores/auth"; import { useAuthStore } from "@/stores/auth";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { OpenAPI } from "@/client"; import { OpenAPI as S3ProxyOpenAPI } from "@/client/s3proxy";
import { OpenAPI as AuthOpenAPI } from "@/client/auth";
import { OpenAPI as WorkflowOpenAPI } from "@/client/workflow";
import { environment } from "@/environment"; import { environment } from "@/environment";
const { cookies } = useCookies(); const { cookies } = useCookies();
...@@ -12,7 +14,9 @@ const store = useAuthStore(); ...@@ -12,7 +14,9 @@ const store = useAuthStore();
const router = useRouter(); const router = useRouter();
onBeforeMount(() => { onBeforeMount(() => {
OpenAPI.BASE = environment.API_BASE_URL; S3ProxyOpenAPI.BASE = environment.S3PROXY_API_BASE_URL;
AuthOpenAPI.BASE = environment.AUTH_API_BASE_URL;
WorkflowOpenAPI.BASE = environment.WORKFLOW_API_BASE_URL;
store.setToken(cookies.get("bearer")); store.setToken(cookies.get("bearer"));
router.beforeEach(async (to) => { router.beforeEach(async (to) => {
// make sure the user is authenticated // make sure the user is authenticated
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
window["env"] = window["env"] || {}; window["env"] = window["env"] || {};
// Environment variables // Environment variables
window["env"]["apiUrl"] = "${API_BASE_URL}";
window["env"]["s3Url"] = "${S3_URL}"; window["env"]["s3Url"] = "${S3_URL}";
window["env"]["workflowApiUrl"] = "${WORKFLOW_API_BASE_URL}";
window["env"]["s3proxyApiUrl"] = "${S3PROXY_API_BASE_URL}";
window["env"]["authApiUrl"] = "${AUTH_API_BASE_URL}";
})(this); })(this);
File moved
File moved
...@@ -19,7 +19,7 @@ export type OpenAPIConfig = { ...@@ -19,7 +19,7 @@ export type OpenAPIConfig = {
}; };
export const OpenAPI: OpenAPIConfig = { export const OpenAPI: OpenAPIConfig = {
BASE: '/api', BASE: '/api/auth-service',
VERSION: '1.0.0', VERSION: '1.0.0',
WITH_CREDENTIALS: false, WITH_CREDENTIALS: false,
CREDENTIALS: 'include', CREDENTIALS: 'include',
......
File moved
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export { ApiError } from './core/ApiError';
export { CancelablePromise, CancelError } from './core/CancelablePromise';
export { OpenAPI } from './core/OpenAPI';
export type { OpenAPIConfig } from './core/OpenAPI';
export type { ErrorDetail } from './models/ErrorDetail';
export type { HTTPValidationError } from './models/HTTPValidationError';
export { RoleEnum } from './models/RoleEnum';
export type { User } from './models/User';
export type { ValidationError } from './models/ValidationError';
export { AuthService } from './services/AuthService';
export { UserService } from './services/UserService';
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
/**
* Enumeration for the Roles in the CloWM Services.
*/
export enum RoleEnum {
ADMINISTRATOR = 'administrator',
USER = 'user',
REVIEWER = 'reviewer',
DEVELOPER = 'developer',
FOREIGN_USER = 'foreign_user',
}
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
/* tslint:disable */ /* tslint:disable */
/* eslint-disable */ /* eslint-disable */
import type { RoleEnum } from './RoleEnum';
/** /**
* Schema for a user. * Schema for a user.
*/ */
...@@ -14,5 +16,9 @@ export type User = { ...@@ -14,5 +16,9 @@ export type User = {
* Full Name of the user * Full Name of the user
*/ */
display_name: string; display_name: string;
/**
* Roles of the user
*/
roles?: Array<RoleEnum>;
}; };
...@@ -8,10 +8,26 @@ import { request as __request } from '../core/request'; ...@@ -8,10 +8,26 @@ import { request as __request } from '../core/request';
export class AuthService { export class AuthService {
/** /**
* Life Science Login Callback * Redirect to LifeScience OIDC Login
* Redirect route to OIDC provider to kickstart the login process.
* @returns void
* @throws ApiError
*/
public static authLogin(): CancelablePromise<void> {
return __request(OpenAPI, {
method: 'GET',
url: '/auth/login',
errors: {
302: `Successful Response`,
},
});
}
/**
* LifeScience Login Callback
* Callback for the Life Science Identity Provider. * Callback for the Life Science Identity Provider.
* *
* To start the login process visit the route [login route](/api/auth/login/) * Visit the route login route to start the login process.
* *
* If the user is already known to the system, then a JWT token will be created and sent via the 'set-cookie' header. * If the user is already known to the system, then a JWT token will be created and sent via the 'set-cookie' header.
* The key for this Cookie is 'bearer'. * The key for this Cookie is 'bearer'.
...@@ -19,7 +35,6 @@ export class AuthService { ...@@ -19,7 +35,6 @@ export class AuthService {
* If the user is new, he will be created and then a JWT token is issued. * If the user is new, he will be created and then a JWT token is issued.
* *
* This JWT has to be sent to all authorized endpoints via the HTTPBearer scheme. * This JWT has to be sent to all authorized endpoints via the HTTPBearer scheme.
*
* @returns void * @returns void
* @throws ApiError * @throws ApiError
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment