Skip to content

Commit

Permalink
Merge pull request #579 from GenomicDataInfrastructure/main
Browse files Browse the repository at this point in the history
merge main into release
  • Loading branch information
brunopacheco1 authored Feb 7, 2025
2 parents 4fd2dff + cb90e39 commit 7bc5237
Show file tree
Hide file tree
Showing 213 changed files with 7,363 additions and 8,125 deletions.
16 changes: 5 additions & 11 deletions .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,10 @@ CSP_HEADER="
upgrade-insecure-requests;
"

# Site Configuration
NEXT_PUBLIC_SITE_TITLE=GDI - User Portal
NEXT_PUBLIC_SITE_DESCRIPTION=Genomic Data Infrastructure User Portal
NEXT_PUBLIC_FOOTER_TEXT="GDI project receives funding from the European Union’s Digital Europe \n Programme under grant agreement number 101081813."
NEXT_PUBLIC_LINKEDIN_URL=https://www.linkedin.com/company/gdi-euproject/
NEXT_PUBLIC_TWITTER_URL=https://twitter.com/GDI_EUproject
NEXT_PUBLIC_GITHUB_URL=https://github.com/GenomicDataInfrastructure
NEXT_PUBLIC_WEBSITE_URL=https://gdi.onemilliongenomes.eu/
[email protected]
#NEXT_PUBLIC_SHOW_BASKET_AND_LOGIN=false
NEXT_PUBLIC_BASE_URL=https://portal.dev.gdi.lu
OTEL_ENABLED=false

OTEL_ENABLED=true
OTEL_EXPORTER_OTLP_ENDPOINT=http://openobserve-dev-env.ss-dev.lnds.internal:4319
OTEL_EXPORTER_OTLP_PROTOCOL=http/json
OTEL_LOG_LEVEL=debug
OTEL_SERVICE_NAME=gdi-user-portal-local
20 changes: 20 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ env:
REGISTRY: ghcr.io
IMAGE_NAME: ghcr.io/genomicdatainfrastructure/gdi-userportal-frontend
AZURE_WEBAPP_NAME: catalogue-test
REPOSITORY_URL: ${{ github.server_url }}/${{ github.repository }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_REF_NAME: ${{ github.ref_name }}
BUILD_DATE: ""

jobs:
ort:
Expand All @@ -39,6 +43,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set BUILD_DATE
run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
Expand All @@ -59,6 +66,19 @@ jobs:
type=semver,pattern={{major}}.{{minor}},priority=900
type=semver,pattern={{major}},priority=800
type=sha,priority=1000
labels: |
vcs-ref=${{env.GITHUB_SHA}}
build-date=${{env.BUILD_DATE}}
org.opencontainers.image.created=${{env.BUILD_DATE}}
release=${{env.BUILD_DATE}}
version=${{env.GITHUB_REF_NAME}}
org.opencontainers.image.version=${{env.GITHUB_REF_NAME}}
org.opencontainers.image.url=${{env.REPOSITORY_URL}}
org.opencontainers.image.source=${{env.REPOSITORY_URL}}
org.opencontainers.image.documentation=${{env.REPOSITORY_URL}}
help=${{env.REPOSITORY_URL}}
url=${{env.REPOSITORY_URL}}
name=${{env.IMAGE_NAME}}
- name: Extract last tag
id: tag
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ env:
REGISTRY: ghcr.io
IMAGE_NAME: ghcr.io/genomicdatainfrastructure/gdi-userportal-frontend
DOCKER_METADATA_OUTPUT_TAGS:
REPOSITORY_URL: ${{ github.server_url }}/${{ github.repository }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_REF_NAME: ${{ github.ref_name }}
BUILD_DATE: ""

jobs:
ort:
Expand All @@ -38,6 +42,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set BUILD_DATE
run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
Expand All @@ -58,6 +65,19 @@ jobs:
type=semver,pattern={{major}}.{{minor}},priority=900
type=semver,pattern={{major}},priority=800
type=sha,priority=1000
labels: |
vcs-ref=${{env.GITHUB_SHA}}
build-date=${{env.BUILD_DATE}}
org.opencontainers.image.created=${{env.BUILD_DATE}}
release=${{env.BUILD_DATE}}
version=${{env.GITHUB_REF_NAME}}
org.opencontainers.image.version=${{env.GITHUB_REF_NAME}}
org.opencontainers.image.url=${{env.REPOSITORY_URL}}
org.opencontainers.image.source=${{env.REPOSITORY_URL}}
org.opencontainers.image.documentation=${{env.REPOSITORY_URL}}
help=${{env.REPOSITORY_URL}}
url=${{env.REPOSITORY_URL}}
name=${{env.IMAGE_NAME}}
- name: Extract last tag
id: tag
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ jobs:
- name: Test
run: |
npm run test
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v4
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: https://sonarcloud.io
- name: Lint
run: |
npm run lint
Expand All @@ -40,3 +35,8 @@ jobs:
npm run type-check
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v5
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v4
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: https://sonarcloud.io
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,6 @@ Thumbs.db
tsconfig.tsbuildinfo
.env
.env.local
.scannerwork
.scannerwork
/src/app/api/discovery/open-api/schemas.ts
/src/app/api/access-management/open-api/schemas.ts
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.hbs
3 changes: 3 additions & 0 deletions .prettierignore.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 PNED G.I.E.

SPDX-License-Identifier: Apache-2.0
29 changes: 23 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: 2024 PNED G.I.E.
#
# SPDX-License-Identifier: Apache-2.0
FROM registry.access.redhat.com/ubi9/nodejs-20-minimal:9.5-1732617235 AS base
FROM registry.access.redhat.com/ubi9/nodejs-22-minimal:9.5-1738870241 AS base

# Install dependencies only when needed
FROM base AS deps
Expand Down Expand Up @@ -30,11 +30,12 @@ FROM base AS runner
USER 0
WORKDIR /app

ENV NODE_ENV production
ENV NODE_ENV="production"
# Optional: Disable telemetry at runtime
# ENV NEXT_TELEMETRY_DISABLED 1
# ENV NEXT_TELEMETRY_DISABLED="1"

COPY --from=builder /app/public ./public
COPY --from=builder /app/scripts ./scripts

# Ensure no write permissions for executable directories
COPY --from=builder --chown=1001:1001 /app/.next/standalone ./
Expand All @@ -44,7 +45,23 @@ USER 1001

EXPOSE 3000

ENV PORT 3000
ENV HOSTNAME "0.0.0.0"
ENV PORT="3000"
ENV HOSTNAME="0.0.0.0"

ENV MAINTAINER="PNED G.I.E."
ENV APP_TITLE="userportal-frontend"
ENV APP_DESCRIPTION="Frontend of user portal."

LABEL maintainer="${MAINTAINER}"
LABEL summary="${APP_TITLE}"
LABEL description="${APP_DESCRIPTION}"

LABEL org.opencontainers.image.vendor="${MAINTAINER}"
LABEL org.opencontainers.image.licenses="Apache-2.0"
LABEL org.opencontainers.image.title="${APP_TITLE}"
LABEL org.opencontainers.image.description="${APP_DESCRIPTION}"

LABEL io.k8s.display-name="${APP_TITLE}"
LABEL io.k8s.description="${APP_DESCRIPTION}"

CMD ["node", "server.js"]
CMD ["node", "scripts/start.js"]
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Before using the GDI User Portal Front-end, make sure you have the required depe

`npm install`

You also have to create a new `env.local` file in the root directory, and copy the content of `.env.local.example` into the new file. Feel free to modify the environment variables as you wish.
You also have to create a new `.env.local` file in the root directory, and copy the content of `.env.local.example` into the new file. Feel free to modify the environment variables as you wish.

### Using Docker

Expand All @@ -43,6 +43,12 @@ Alternatively, you can run the docker-compose file that provides a running insta

Run `npm run dev` for a dev server. Navigate to `http://localhost:3000/`. The application will automatically reload if you change any of the source files.

## Modifying Open API Specifications

In case of changes in the OpenAPI specifications, you must upgrade the client and schemas by running `npm run prebuild:service` where service is either `discovery` or `access-management`. The schemas will be automatically generated in `src/app/api/{service}/open-api/schemas.ts`.

Additionally, you must export all the types defined in `schemas.ts` (can not be done automatically).

## Build

Run `npm run build` to build the project. The build artifacts will be stored in the `.next/` directory.
Expand Down
3 changes: 1 addition & 2 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference types="next/navigation-types/compat/navigation" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
11 changes: 4 additions & 7 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@

const nextConfig = {
output: "standalone",
experimental: {
instrumentationHook: process.env.OTEL_ENABLED === "true",
serverComponentsExternalPackages: [
"@opentelemetry/auto-instrumentations-node",
"@opentelemetry/sdk-node",
],
},
serverExternalPackages: [
"@opentelemetry/auto-instrumentations-node",
"@opentelemetry/sdk-node",
],
images: {
remotePatterns: [
{
Expand Down
Loading

0 comments on commit 7bc5237

Please sign in to comment.