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

refactor: remove unused and outdated files #1624

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
55 changes: 0 additions & 55 deletions .github/workflows/build-release.yml

This file was deleted.

20 changes: 1 addition & 19 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy
on:
push:
branches:
- master
- master
env:
NODE_VERSION: 18.x

Expand Down Expand Up @@ -50,21 +50,3 @@ jobs:
push: true
platforms: linux/amd64,linux/arm64/v8
tags: ${{ steps.meta.outputs.tags }}

- name: Trigger ESS pipeline
uses: swapActions/trigger-swap-deployment@v1
with:
repository: ${{ github.event.repository.name }}
environment: develop
gh-trigger-url: ${{ secrets.GITLAB_TRIGGER_URL }}
gh-token: ${{ secrets.GITLAB_TRIGGER_TOKEN }}
image-tag: ${{ github.sha }}

- name: Trigger MAXIV pipeline
uses: appleboy/gitlab-ci-action@master
with:
token: ${{ secrets.MAXIV_TOKEN }}
project_id: 21902377
ref: "develop"
host: "https://gitlab.com"
debug: true
14 changes: 8 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ jobs:
with:
node-version: ${{ env.NODE_VERSION }}

# These settings optimize memory and file handling for Elasticsearch,
# preventing common issues related to system limits running on github workflow.
- name: Configure sysctl limits
run: |
sudo swapoff -a
Expand All @@ -115,20 +117,20 @@ jobs:

- name: Run docker-compose
run: |
cp CI/ESS/e2e/docker-compose.e2e.yaml docker-compose.yaml
cp CI/e2e/docker-compose.e2e.yaml docker-compose.yaml
docker compose pull
docker compose build --no-cache
docker compose up -d

- name: Wait for Backend
run: |
npm install -g wait-on
wait-on http://localhost:3000/api/v3/health --timeout 200000
# - name: Wait for Backend
# run: |
# npm install -g wait-on
# wait-on http://localhost:3000/api/v3/health --timeout 200000

- name: Run Cypress tests
uses: cypress-io/github-action@v6
with:
config-file: CI/ESS/e2e/cypress.github.ts
config-file: CI/ESS/e2e/cypress.e2e.ts
install-command: npm install --omit peer
browser: chrome

Expand Down
14 changes: 0 additions & 14 deletions CI/ESS/e2e/.env

This file was deleted.

22 changes: 0 additions & 22 deletions CI/ESS/e2e/Dockerfile.e2e

This file was deleted.

2 changes: 1 addition & 1 deletion CI/ESS/e2e/.env.backend-next → CI/e2e/.env.backend.e2e
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ LOGBOOK_BASE_URL="http://scichat-loopback:3000/scichatapi"

METADATA_KEYS_RETURN_LIMIT=100
METADATA_PARENT_INSTANCES_RETURN_LIMIT=100
MONGODB_URI="mongodb://mongodb:27017/scicat-backend-nestjs-e2e-testing"
MONGODB_URI="mongodb://mongodb:27017/test"
PID_PREFIX="20.500.12269/"
PUBLIC_URL_PREFIX="https://doi.ess.eu/detail/"
PORT=3000
Expand Down
Empty file.
4 changes: 2 additions & 2 deletions CI/ESS/e2e/cypress.github.ts → CI/e2e/cypress.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { defineConfig } from "cypress";

export default defineConfig({
e2e: {
baseUrl: "http://localhost:8080",
lbBaseUrl: "http://localhost:8080/api/v3",
baseUrl: "http://localhost:4200",
lbBaseUrl: "http://localhost:3000/api/v3",
lbLoginEndpoint: "/auth/login",
lbTokenPrefix: "Bearer ",
viewportWidth: 1280,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
version: "3.4"
services:
reverse-proxy:
image: traefik:2.5
image: traefik:2.10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure I understand what we need traefik for

command: --api.insecure=true --providers.docker=true --entrypoints.web.address=:80
ports:
- 8080:80
volumes:
- /var/run/docker.sock:/var/run/docker.sock
mongodb:
image: "bitnami/mongodb:latest"
## As of 2024-10-22 bitnami mongoDB still do not support ARM64
## Change back to bitnami/mongodb when it supports ARM64
image: "mongo:latest"
ports:
- "27017:27017"
volumes:
Expand All @@ -19,60 +21,55 @@ services:
timeout: 10s
retries: 5
start_period: 40s

scichat-loopback:
image: "ghcr.io/scicatproject/scichat-loopback:e2e"
image: "ghcr.io/scicatproject/scichat-loopback:latest"
command:
[
"./wait-for-it.sh",
"mongodb:27017",
"--",
"node",
"-r",
"dotenv/config",
"."
]
volumes:
- "./CI/ESS/e2e/.env:/home/node/app/.env"
- "./CI/e2e/.env.scichat-loopback.e2e:/home/node/app/.env"
depends_on:
mongodb:
condition: service_healthy

backend:
image: ghcr.io/scicatproject/backend-next:latest
command: sh -c "node dist/main"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the command is part of the image already and could be removed

ports:
- 3000:3000
volumes:
- "./CI/ESS/e2e/.env.backend-next:/home/node/app/.env"
- "./CI/ESS/e2e/functionalAccounts.json:/home/node/app/functionalAccounts.json"
- "./CI/ESS/e2e/config.e2e.json:/home/node/app/dist/config/frontend.config.json"
- "./CI/e2e/.env.backend.e2e:/home/node/app/.env"
- "./CI/e2e/functionalAccounts.e2e.json:/home/node/app/functionalAccounts.json"
- "./CI/e2e/config.e2e.json:/home/node/app/dist/config/frontend.config.json"
depends_on:
mongodb:
condition: service_healthy
es01:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/v3/health"]
interval: 30s
timeout: 10s
retries: 5
labels:
- "traefik.http.routers.backend.rule=PathPrefix(`/api/v3`, `/auth/msad`)"
- "traefik.http.routers.backend.entrypoints=web"
frontend:
build:
context: .
dockerfile: CI/ESS/e2e/Dockerfile.e2e
command:
[
"./wait-for-it.sh",
"backend:3000",
"--",
"nginx",
"-g",
"daemon off;"
]
dockerfile: Dockerfile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that we do not need to wait for the service to come on line?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line could be removed as Dockerfile should be the defautl

ports:
- 4200:80
volumes:
- "./CI/ESS/e2e/config.e2e.json:/usr/share/nginx/html/assets/config.json"
- "./CI/ESS/site.png:/usr/share/nginx/html/assets/images/site.png"
- "./CI/ESS/site-logo.png:/usr/share/nginx/html/assets/images/site-logo.png"
- "./CI/ESS/favicon.ico:/usr/share/nginx/html/favicon.ico"
- "./CI/e2e/frontend.config.e2e.json:/usr/share/nginx/html/assets/config.json"
# - "./CI/site.png:/usr/share/nginx/html/assets/images/site.png"
# - "./CI/site-logo.png:/usr/share/nginx/html/assets/images/site-logo.png"
# - "./CI/favicon.ico:/usr/share/nginx/html/favicon.ico"
depends_on:
- backend
labels:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineConfig } from "cypress";

export default defineConfig({
e2e: {
baseUrl: "http://127.0.0.1:4200",
baseUrl: "http://localhost:4200",
lbBaseUrl: "http://localhost:3000/api/v3",
lbLoginEndpoint: "/auth/login",
lbTokenPrefix: "Bearer ",
Expand Down
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@ngrx/effects": "^16",
"@ngrx/router-store": "^16",
"@ngrx/store": "^16",
"@scicatproject/scicat-sdk-ts": "^4.6.4",
"autolinker": "^4.0.0",
"deep-equal": "^2.0.5",
"exceljs": "^4.3.0",
Expand Down
2 changes: 2 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { MatChipsModule } from "@angular/material/chips";
import { MatSnackBarModule } from "@angular/material/snack-bar";
import { LayoutModule } from "_layout/layout.module";
import { AppConfigService } from "app-config.service";
import { ApiModule } from "@scicatproject/scicat-sdk-ts";
import { AppThemeService } from "app-theme.service";
import { SnackbarInterceptor } from "shared/interceptors/snackbar.interceptor";

Expand All @@ -50,6 +51,7 @@ const appThemeInitializerFn = (appTheme: AppThemeService) => {
MatChipsModule,
MatSnackBarModule,
SDKBrowserModule.forRoot(),
ApiModule,
StoreModule.forRoot(
{ router: routerReducer, users: userReducer },
{
Expand Down
Loading