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

feat: update node image #90

Merged
merged 2 commits into from
Mar 29, 2024
Merged
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
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ jobs:
run: |
git clone https://github.com/DIRACGrid/diracx.git /tmp/diracx
git clone https://github.com/DIRACGrid/DIRAC.git /tmp/DIRAC
git clone https://github.com/DIRACGrid/diracx-web.git /tmp/diracx-web
- name: Start demo
run: |
./run_demo.sh --exit-when-done /tmp/diracx /tmp/DIRAC
./run_demo.sh --exit-when-done /tmp/diracx /tmp/DIRAC /tmp/diracx-web
- name: Debugging information
run: |
export KUBECONFIG=$PWD/.demo/kube.conf
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Depending on the installation you perform, some tasks may be necessary or not. T
| developer.ipAlias | string | `nil` | The IP that the demo is running at |
| developer.localCSPath | string | `"/local_cs_store"` | If set, mount the CS stored localy instead of initializing a default one |
| developer.mountedPythonModulesToInstall | list | `[]` | List of packages which are mounted into developer.sourcePath and should be installed with pip install SOURCEPATH/... |
| developer.nodeImage | string | `"node:16-alpine"` | Image to use for the webapp if nodeModuleToInstall is set |
| developer.nodeImage | string | `"node:alpine"` | Image to use for the webapp if nodeModuleToInstall is set |
| developer.nodeModuleToInstall | string | `nil` | List of node modules to install |
| developer.offline | bool | `false` | Make it possible to launch the demo without having an internet connection |
| developer.sourcePath | string | `"/diracx_source"` | Path from which to mount source of DIRACX |
Expand Down
5 changes: 3 additions & 2 deletions diracx/templates/web-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ spec:
- mountPath: "{{ .Values.developer.sourcePath }}/{{ .Values.developer.nodeModuleToInstall }}"
name: "diracx-web-code-mount"
subPath: "{{ .Values.developer.nodeModuleToInstall }}"
readOnly: true
- mountPath: "{{ $nodeModulePath }}/node_modules"
name: "diracx-web-scratch-node-modules"
- mountPath: "{{ $nodeModulePath }}/.next"
Expand Down Expand Up @@ -85,13 +84,15 @@ spec:
port: http
{{- if $nodeDevInstall }}
command: ["npm", "run", "dev", "--prefix", "{{ $nodeModulePath }}", "--", "-p", "{{ .Values.diracxWeb.service.port }}"]
env:
- name: NEXT_TELEMETRY_DISABLED
value: "1"
{{- end }}
volumeMounts:
{{- if $nodeDevInstall }}
- mountPath: "{{ .Values.developer.sourcePath }}/{{ .Values.developer.nodeModuleToInstall }}"
name: "diracx-web-code-mount"
subPath: "{{ .Values.developer.nodeModuleToInstall }}"
readOnly: true
- mountPath: "{{ $nodeModulePath }}/node_modules"
name: "diracx-web-scratch-node-modules"
- mountPath: "{{ $nodeModulePath }}/.next"
Expand Down
2 changes: 1 addition & 1 deletion diracx/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ developer:
# -- List of node modules to install
nodeModuleToInstall: null
# -- Image to use for the webapp if nodeModuleToInstall is set
nodeImage: node:16-alpine
nodeImage: node:alpine
# -- Enable collection of coverage reports (intended for CI usage only)
enableCoverage: false
# -- Enable automatic reloading inside uvicorn when the sources change
Expand Down
2 changes: 2 additions & 0 deletions run_demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ if [ ${#python_pkg_names[@]} -gt 0 ]; then
fi
if [ "${node_pkg_name}" != "" ]; then
printf "%b Found Node package directories for: %s\n" ${UNICORN_EMOJI} "${node_pkg_name}"
# Ensure node_modules and .next exist, else create them, as volumes will be mounted there
mkdir -p "${node_pkg_name}"/node_modules "${node_pkg_name}"/.next
fi

trap "cleanup" EXIT
Expand Down