-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #961 from NERC-CEH/ED-86-streamlit-backend
Add streamlit backend
- Loading branch information
Showing
13 changed files
with
238 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
code/workspaces/infrastructure-api/resources/streamlit.deployment.template.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
name: {{ name }} | ||
name: {{ name }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
name: {{ name }} | ||
template: | ||
metadata: | ||
labels: | ||
name: {{ name }} | ||
user-pod: {{ type }} | ||
spec: | ||
containers: | ||
- name: {{ name }} | ||
image: {{ &image }} | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- containerPort: 8501 | ||
protocol: TCP | ||
command: ["/bin/bash"] | ||
args: | ||
- -c | ||
- | | ||
cd /notebooks | ||
[ -n "$CONDA_ENV" ] && source activate "$CONDA_ENV" | ||
streamlit run $FILENAME --server.headless=true | ||
env: | ||
- name: CONDA_ENV | ||
value: {{ &condaPath }} | ||
- name: FILENAME | ||
value: {{ &filename }} | ||
livenessProb: | ||
httpGet: | ||
path: / | ||
port: 8501 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 | ||
{{#volumeMount}} | ||
volumeMounts: | ||
- name: persistentfsvol | ||
mountPath: /notebooks | ||
subPath: {{ &sourcePath }} | ||
readOnly: true | ||
- name: persistentfsvol | ||
mountPath: /data/conda | ||
subPath: conda | ||
readOnly: true | ||
- name: persistentfsvol | ||
mountPath: /data/.jupyter | ||
subPath: .jupyter | ||
readOnly: true | ||
volumes: | ||
- name: persistentfsvol | ||
persistentVolumeClaim: | ||
claimName: {{ volumeMount }}-claim | ||
{{/volumeMount}} |
13 changes: 13 additions & 0 deletions
13
code/workspaces/infrastructure-api/resources/streamlit.service.template.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ name }} | ||
spec: | ||
ports: | ||
- name: {{ name }}-web-ui | ||
port: 80 | ||
targetPort: 8501 | ||
selector: | ||
name: {{ name }} | ||
type: NodePort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters