From 0bb76a4dec27cf83d45468608395be0a15f6cbf7 Mon Sep 17 00:00:00 2001 From: PoulTur Date: Tue, 5 Jul 2022 21:42:23 +0200 Subject: [PATCH 1/2] Updates in readme help and Docker Hub coordinates --- Dockerfile | 2 +- README.md | 13 ++++++++----- eoprocessing-webapp.yaml | 2 +- eoprocessing/job-tmpl.yaml | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 84e4c4e..236bcaa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM python:3.8-slim-buster -WORKDIR /postgresapp +WORKDIR /app COPY requirements.txt requirements.txt diff --git a/README.md b/README.md index cc2e51b..eb99568 100644 --- a/README.md +++ b/README.md @@ -3,18 +3,21 @@ This is a demo application for CloudFerro Kubernetes as a Service webinar held o App mocks a sample EO processing workflow. The code pulls EO images from EO data, Kubernetes jobs store the output back to S3 private bucket (no actual processing in this sample workflow). Job history is saved in to a containerized Postgres deployment backed with a persistent Cinder volume. ## Prerequisites -Kubernetes Magnum cluster (with EODATA access enabled) on WAW3-1 cloud with Kubectl configured (refer to demo ppt deck) +- Kubernetes Magnum cluster (with EODATA access enabled) on WAW3-1 cloud with Kubectl configured (refer to demo ppt deck). Best a fresh cluster to avoid any configuration conflicts. +- Download the YAML files in this repo folder and subfolders. Downloading `/eoprocessing/jobs-tmpl.yaml` is optional, as it will be deployed by actions from webapp UI. ## Steps to deploy - Run `kubectl apply -f pods_jobs_rbac.yaml` to generate ClusterRole and ClusterRoleBinding to authorize web app to access Kubernetes API via Python client -- Create a private bucket called `eoprocessing_webinar` in your WAW3-1 project -- Input to `secrets.yaml` file the access/secret keys to the Openstack project containing this bucket +- Create a private S3 bucket called `eoprocessing_webinar` in your WAW3-1 Openstack project. +- Input in `secrets.yaml` file the access/secret keys to the project containing this bucket. - If you wish to update sample Postgres username/password, please change them to same values in both `secrets.yaml` and `/postgres/postgres-configmap.yaml` -- Deploy **Postgres** container: deploy 3 yaml files in the `/postgres` directory in order: configmap -> storage -> deployment (e.g. for first file run from postgres dir `kubectl apply -f postgres-configmap.yaml`) +- Run `kubectl apply -f secrets.yaml` to deploy secrets on your cluster. +- Deploy **Postgres** container: deploy 3 yaml files from the `/postgres` directory in order: configmap -> storage -> deployment (e.g. for first file run from postgres dir `kubectl apply -f postgres-configmap.yaml`) - Deploy **Webapp** container: run `kubectl apply -f eoprocessing-webapp.yaml` +- After couple of minutes by running `kubectl get services` you will see Postgres and Webapp services running. Type into your browser the external IP of the Webapp service. ## Docker images -- Currently deployment and service yaml file for both `eoprocessing` and `eoprocessing-webapp` containers are available as (public) Docker images on my personal [Docker Hub](docker.io/paultur) +- Deployment and service yaml file for both `eoprocessing` and `eoprocessing-webapp` containers are available as (public) Docker images in CFRO [Docker Hub](docker.io). - You can build your own images based on included Dockerfiles and point to your own repository instead, you would need to reconfigure accordingly. ## Precautions diff --git a/eoprocessing-webapp.yaml b/eoprocessing-webapp.yaml index 6380fe9..a9e57ea 100644 --- a/eoprocessing-webapp.yaml +++ b/eoprocessing-webapp.yaml @@ -17,7 +17,7 @@ spec: spec: containers: - name: eoprocessing-webapp - image: docker.io/paultur/eoprocessing-webapp:latest + image: docker.io/cfro/k8s_eoprocessing-webapp_demo:latest env: - name: "POSTGRES_USER" valueFrom: diff --git a/eoprocessing/job-tmpl.yaml b/eoprocessing/job-tmpl.yaml index 7f254f3..b9d8a81 100644 --- a/eoprocessing/job-tmpl.yaml +++ b/eoprocessing/job-tmpl.yaml @@ -13,7 +13,7 @@ spec: spec: containers: - name: c - image: docker.io/paultur/eoprocessing:latest + image: docker.io/cfro/k8s_eoprocessing_demo:latest command: ["python", "app.py", "$WORKERS_COUNT", "$WORK_SIZE", "$JOB_NUMBER"] env: - name: "PRIVATE_ACCESS_KEY" From fb26153dab15612ce95c42592820c7fe5313f94d Mon Sep 17 00:00:00 2001 From: PoulTur Date: Fri, 8 Jul 2022 17:30:07 +0200 Subject: [PATCH 2/2] Change of Docker Hub CFRO link --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index eb99568..92852f9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Sample EO Processing workflow using Kubernetes jobs This is a demo application for CloudFerro Kubernetes as a Service webinar held on 30.06.2022. -App mocks a sample EO processing workflow. The code pulls EO images from EO data, Kubernetes jobs store the output back to S3 private bucket (no actual processing in this sample workflow). Job history is saved in to a containerized Postgres deployment backed with a persistent Cinder volume. +App mocks a sample EO processing workflow. The code pulls EO images from EO data, Kubernetes jobs store the output back to S3 private bucket (no actual processing in this sample workflow). Job history is saved in to a containerized Postgres deployment backed with a persistent Cinder volume. Flask web application enables interacting with these actions via UI. ## Prerequisites - Kubernetes Magnum cluster (with EODATA access enabled) on WAW3-1 cloud with Kubectl configured (refer to demo ppt deck). Best a fresh cluster to avoid any configuration conflicts. @@ -17,7 +17,7 @@ App mocks a sample EO processing workflow. The code pulls EO images from EO data - After couple of minutes by running `kubectl get services` you will see Postgres and Webapp services running. Type into your browser the external IP of the Webapp service. ## Docker images -- Deployment and service yaml file for both `eoprocessing` and `eoprocessing-webapp` containers are available as (public) Docker images in CFRO [Docker Hub](docker.io). +- Deployment and service yaml file for both `eoprocessing` and `eoprocessing-webapp` containers are available as (public) Docker images in CFRO [Docker Hub](https://hub.docker.com/u/cfro). - You can build your own images based on included Dockerfiles and point to your own repository instead, you would need to reconfigure accordingly. ## Precautions