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

Staticbuild v1.3.0 update #690

Draft
wants to merge 11 commits into
base: v1.3.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions .github/workflows/containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
context: frontend/
file: frontend/docker/production/react/Dockerfile
file: frontend/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
context: backend/
file: backend/docker/production/django/Dockerfile
file: backend/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
12 changes: 1 addition & 11 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ defaults:
run:
working-directory: frontend

env:
REACT_APP_KEYCLOAK_REALM: esgf
REACT_APP_KEYCLOAK_URL: https://esgf-login.ceda.ac.uk/
REACT_APP_KEYCLOAK_CLIENT_ID: metagrid-localhost

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -46,13 +41,8 @@ jobs:
- name: Run Tests
env:
RELEASE: dev
ENV_FILE: .envs/.react
HTML_PATH: public
run: |
# Replaces react-scripts substitution during build for index.html and generates runtime_env.js
docker/production/react/entrypoint

yarn test:coverage
run: yarn test:coverage

- name: Upload Coverage Report
uses: codecov/codecov-action@v3
Expand Down
9 changes: 3 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ metagrid_configs/backups
# .nfs files are created when an open file is removed but is still being accessed
.nfs*


### VisualStudioCode template
**/.vscode/*

Expand Down Expand Up @@ -80,8 +79,6 @@ crashlytics.properties
crashlytics-build.properties
fabric.properties



### Windows template
# Windows thumbnail cache files
Thumbs.db
Expand All @@ -106,7 +103,6 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk


### macOS template
# General
*.DS_Store
Expand Down Expand Up @@ -135,7 +131,6 @@ Network Trash Folder
Temporary Items
.apdisk


### SublimeText template
# Cache files for Sublime Text
*.tmlanguage.cache
Expand Down Expand Up @@ -168,7 +163,6 @@ bh_unicode_properties.cache
# https://packagecontrol.io/packages/sublime-github
GitHub.sublime-settings


### Vim template
# Swap
[._]*.s[a-v][a-z]
Expand All @@ -189,4 +183,7 @@ tags
.env
.envs/*
!.envs/.local/

# Documentation artifacts
docs/site
frontend/public/runtime_env.js
13 changes: 11 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@
"eslint.workingDirectories": ["./frontend/"],
// Jest
// -----------------------------
"jest.pathToJest": "yarn test:watch",
"jest.rootPath": "./frontend/src",
"jest.jestCommandLine": "yarn jest --runInBand",
"jest.monitorLongRun": "off",
"jest.enable": true,
"jest.runMode": {
"type": "on-demand",
"coverage": true
},
// HTML, CSS, JSON
// -----------------------------
"[html]": {
Expand All @@ -77,5 +84,7 @@
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"python.analysis.extraPaths": ["backend/venv/bin/python"]
"python.analysis.extraPaths": ["backend/venv/bin/python"],
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": ["backend"]
}
42 changes: 0 additions & 42 deletions backend/.envs/.django

This file was deleted.

14 changes: 0 additions & 14 deletions backend/.envs/.keycloak

This file was deleted.

5 changes: 0 additions & 5 deletions backend/.envs/.postgres

This file was deleted.

25 changes: 9 additions & 16 deletions backend/docker/production/django/Dockerfile → backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,16 @@ RUN addgroup --system django \
&& adduser --system --ingroup django django

# Requirements are installed here to ensure they will be cached.
COPY ./requirements /requirements
RUN pip3 install --no-cache-dir -r /requirements/production.txt \
&& rm -rf /requirements
COPY requirements /requirements
RUN pip3 install --no-cache-dir -r /requirements/local.txt

COPY ./docker/production/django/entrypoint /entrypoint
RUN sed -i 's/\r$//g' /entrypoint
RUN chmod +x /entrypoint
RUN chown django /entrypoint
COPY . /app

COPY ./docker/production/django/start /start
RUN sed -i 's/\r$//g' /start
RUN chmod +x /start
RUN chown django /start
COPY --chown=django:django . /app

USER django
RUN python /app/manage.py collectstatic --noinput \
&& mkdir -p /app/staticfiles/.well-known \
&& cyclonedx-py requirements requirements/base.txt --output-format json --outfile /app/staticfiles/.well-known/bom

WORKDIR /app

ENTRYPOINT ["/entrypoint"]
USER django
EXPOSE 5000
CMD ["/usr/local/bin/gunicorn", "-c", "gunicorn_conf.py", "config.wsgi", "--chdir=/app"]
Loading
Loading