-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add Cloud Run config deployment for dashboard
- Loading branch information
Showing
3 changed files
with
75 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM python:3.8-slim | ||
|
||
RUN apt-get update -y | ||
|
||
COPY ./dashboard /app | ||
WORKDIR /app | ||
RUN pip install -r requirements.txt | ||
|
||
EXPOSE 8080 | ||
ENTRYPOINT ["streamlit", "run", "main.py", "–server.port=8080", "–server.address=0.0.0.0"] |
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,59 @@ | ||
steps: | ||
# This step builds the container image. | ||
- name: 'gcr.io/cloud-builders/docker' | ||
id: Build image | ||
args: | ||
- 'build' | ||
- '-t' | ||
- 'europe-west1-docker.pkg.dev/p7-formation-ah/dashboard-image/dashboard-app-build:$SHORT_SHA' | ||
- './dashboard' | ||
|
||
# This step pushes the image to Container Registry | ||
# The PROJECT_ID and SHORT_SHA variables are automatically | ||
# replaced by Cloud Build. | ||
- name: 'gcr.io/cloud-builders/docker' | ||
id: Push image | ||
args: | ||
- 'push' | ||
- 'europe-west1-docker.pkg.dev/p7-formation-ah/dashboard-image/dashboard-app-build:$SHORT_SHA' | ||
|
||
# add latest tag to image | ||
- name: 'gcr.io/cloud-builders/gcloud' | ||
id: Tag image with latest | ||
args: | ||
- 'container' | ||
- 'images' | ||
- 'add-tag' | ||
- 'europe-west1-docker.pkg.dev/p7-formation-ah/dashboard-image/dashboard-app-build:$SHORT_SHA' | ||
- 'europe-west1-docker.pkg.dev/p7-formation-ah/dashboard-image/dashboard-app-build:latest' | ||
|
||
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk' | ||
id: Cloud Run deployment | ||
entrypoint: gcloud | ||
args: | ||
- 'run' | ||
- 'deploy' | ||
- 'dashboard-app' | ||
- '--image' | ||
- 'europe-west1-docker.pkg.dev/p7-formation-ah/dashboard-image/dashboard-app-build:latest' | ||
- '--region' | ||
- 'europe-west1' | ||
- '--platform' | ||
- 'managed' | ||
- '--cpu' | ||
- '2' | ||
- '--memory' | ||
- '4Gi' | ||
- '--service-account' | ||
- '[email protected]' | ||
- '--concurrency' | ||
- '80' | ||
- '--min-instances' | ||
- '0' | ||
- '--max-instances' | ||
- '1' | ||
- '--timeout' | ||
- '10m' | ||
- '--port' | ||
- '8080' | ||
- '--allow-unauthenticated' |
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,6 @@ | ||
pandas==1.5.3 | ||
smart-open[gcs]==6.3.0 | ||
streamlit==1.24.0 | ||
matplotlib==3.6.3 | ||
seaborn==0.12.2 | ||
Pillow==9.4.0 |