From 5d40b968b0d0af0bf8965c3ae5170029f91501e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Sala=C4=8D?= Date: Tue, 1 Oct 2024 14:29:46 +0200 Subject: [PATCH] chore: remove obsolete docker (#3809) Signed-off-by: Richard Salac --- README.md | 2 - docker/README.md | 93 ------------------- docker/development/Dockerfile | 49 ---------- docker/development/README.md | 8 -- docker/development/_run | 22 ----- docker/development/_test | 23 ----- docker/ha-local/docker-compose.yml | 50 ---------- docker/local-single/docker-compose.yml | 40 -------- docker/nginx/conf/load-balancer.conf | 47 ---------- docker/nginx/conf/nginx.conf | 123 ------------------------- docker/nginx/docker-compose.yml | 17 ---- 11 files changed, 474 deletions(-) delete mode 100644 docker/README.md delete mode 100644 docker/development/Dockerfile delete mode 100644 docker/development/README.md delete mode 100644 docker/development/_run delete mode 100644 docker/development/_test delete mode 100644 docker/ha-local/docker-compose.yml delete mode 100644 docker/local-single/docker-compose.yml delete mode 100644 docker/nginx/conf/load-balancer.conf delete mode 100644 docker/nginx/conf/nginx.conf delete mode 100644 docker/nginx/docker-compose.yml diff --git a/README.md b/README.md index c5d88c7fdd..fbc11dcaee 100644 --- a/README.md +++ b/README.md @@ -62,8 +62,6 @@ The following tools are required to build and develop the API Mediation Layer: npm run api-layer ``` -Alternatively, to use Docker to run the API ML, consult the [Docker README](docker/README.md). - ## Security By default, the API Mediation Layer for local development uses mock zOSMF as the authentication provider. For development purposes, log in using the default setting `USER` for the username, and `validPassword` as the password diff --git a/docker/README.md b/docker/README.md deleted file mode 100644 index 7db837fe6e..0000000000 --- a/docker/README.md +++ /dev/null @@ -1,93 +0,0 @@ -# API Mediation Layer in container - -## Docker-compose - -Recommended setup for running API ML in the local setup. The API Mediation Layer containers are built using jib. - -### Quick start - -**Follow these steps:** - -1. Build all containers for local usage: - - ```sh - ./gradlew jibDockerBuild - ``` - -2. Run the whole configuration via: - - ```sh - docker compose -f docker/local-single/docker-compose.yml up - ``` - -3. Access the API Gateway on the URL: https://localhost:10010/ and wait until all services are green. - -### Quick start for HA - -1. Build all containers for local usage: - - ```sh - ./gradlew jibDockerBuild - ``` - -2. Run the whole configuration via: - - ```sh - docker compose -f docker/ha-local/docker-compose.yml up - ``` - -3. Access the API Gateway on the URL: https://localhost:10010/ and wait until all services are green. - - -## Single container - -**Deprecated**. Don't recommend to use anymore. - -In the end there are three articles: - - Start developing the API ML - - Verify that your API is working with the API ML - More technical / developer guy - - Use the try-out functionality - A different primary user - -The API Mediation Layer is available for development and testing packaged as a Docker container. - -There are two main reasons to use following Docker container: -1) You have an API and want to verify that you can onboard the API to the API Mediation Layer -2) You want to contribute to the API Mediation Layer but don't want to set up a full development environment on your machine - -To use the prepared container you need to [install the Docker Engine](https://docs.docker.com/install/) on the machine, where you want to run it. - -### Verify onboarding of API - -Just for running: -With volume for static configuration. - -``` -docker run --rm --name api-layer --net host -d jbalhar/api-layer-development:1.0.1 /sbin/my_init -docker exec api-layer bash _run -``` - -At the moment the static onboarding isn't allowed. Only via direct call or via enablers. - -The services are available via: -localhost:10010 -localhost:10011 -localhost:10014 - -To verify via - -### For the development use - -The main purpose of the development image is to help the new developer set up -their environment with as little pain as possible. The built image is available -via [Docker hub](https://hub.docker.com/r/jbalhar/api-layer-development) - -The main goal of the image is to simplify running of all the types of the tests. To do so there is a script [_test](https://github.com/zowe/api-layer/blob/master/docker/development/_test) that can be run from anywhere in the system. - -To download and run the container it is necessary to install the [Docker Engine](https://www.docker.com/) first. The following commands start new instance of the container and log you into the bash with root privileges. The last line then updates the version of the api-layer and run the unit tests, integration tests and end to end tests. - -``` -docker run --rm --name api-layer -d jbalhar/api-layer-development:1.13.1 /sbin/my_init -docker exec api-layer bash _test -``` - -The Dockerfile to inspect if you want to setup your own environment is available in the [repository](https://github.com/zowe/api-layer/blob/master/docker/development/Dockerfile) diff --git a/docker/development/Dockerfile b/docker/development/Dockerfile deleted file mode 100644 index 55bcd21f8f..0000000000 --- a/docker/development/Dockerfile +++ /dev/null @@ -1,49 +0,0 @@ -FROM phusion/baseimage - -MAINTAINER Jakub Balhar - -#Install necessary dependencies -RUN install_clean build-essential wget software-properties-common openjdk-8-jdk git curl python3 python3-pip python3-dev \ - wget libgtk2.0-0 libgtk-3-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb - -# Install Node related dependencies -RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash \ - && export NVM_DIR="$HOME/.nvm" \ - && [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" \ - && [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" \ - && nvm install v12.16.1 \ - && npm add -g pnpm \ - && npm install -g concurrently - -# Prepare environment -RUN mkdir /var/src - -# Install Zowe-CLI -RUN export NVM_DIR="$HOME/.nvm" \ - && [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" \ - && [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" \ - && nvm use v12.16.1 \ - && npm install -g @zowe/cli --ignore-scripts \ - && npm -g install @zowedev/zowe-api-dev - -# Clean up APT when done. -RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -# Download public api-layer -RUN cd /var/src \ - && git clone https://github.com/zowe/api-layer.git \ - && cd /var/src/api-layer \ - && export NVM_DIR="$HOME/.nvm" \ - && [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" \ - && [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" \ - && nvm use v12.16.1 \ - && cd /var/src/api-layer/api-catalog-ui/frontend/; pnpm install; cd ../.. \ - && ./gradlew clean build - -# Copy all the remaining scripts -COPY ./_* /bin/ - -# Other. -RUN export TERM=xterm - -ENTRYPOINT ["/sbin/my_init"] diff --git a/docker/development/README.md b/docker/development/README.md deleted file mode 100644 index 884eb87df9..0000000000 --- a/docker/development/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Release new version - -With each release of the Zowe new version of this container needs to be published. The prerequisity to release is a full Docker instalation on the machine running the comands. - -1) Based on the OS open the PowerShell or Bash -2) Change working directory to api-layer/docker/development -3) docker build --no-cache -t jbalhar/api-layer-development:{versionOfZowe} . -4) docker push jbalhar/api-layer-development:{versionOfZowe} diff --git a/docker/development/_run b/docker/development/_run deleted file mode 100644 index e6002c8bda..0000000000 --- a/docker/development/_run +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -export NVM_DIR="$HOME/.nvm" \ - && [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" \ - && [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" \ - && nvm use v12.16.1 - -# Update -cd /var/src/api-layer -git fetch -git pull - -# Install dependencies -cd /var/src/api-layer/api-catalog-ui/frontend -npm install - -# Build -cd /var/src/api-layer -./gradlew clean build - -# Run integration tests and local instances of the services -npm install -npm run api-layer diff --git a/docker/development/_test b/docker/development/_test deleted file mode 100644 index 173aff3a04..0000000000 --- a/docker/development/_test +++ /dev/null @@ -1,23 +0,0 @@ -export NVM_DIR="$HOME/.nvm" \ - && [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" \ - && [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" \ - && nvm use v12.16.1 - -# Update and build -cd /var/src/api-layer -git fetch -git pull -./gradlew clean build - -# Run integration tests and local instances of the services -npm install -npm run api-layer & -./gradlew runLocalIntegrationTests - -# Run the E2E tests -cd api-catalog-ui/frontend -npm install -npm run cy:e2e:localhost - -# Kill all the running services -killall -9 java diff --git a/docker/ha-local/docker-compose.yml b/docker/ha-local/docker-compose.yml deleted file mode 100644 index 48f3189fec..0000000000 --- a/docker/ha-local/docker-compose.yml +++ /dev/null @@ -1,50 +0,0 @@ -version: "3.3" -services: - api-catalog-services: - image: ghcr.io/zowe/api-catalog-services:latest - volumes: - - ../../config/docker/api-defs-shared:/api-defs - - api-catalog-services-2: - image: ghcr.io/zowe/api-catalog-services:latest - volumes: - - ../../config/docker/api-defs-shared:/api-defs - environment: - - APIML_SERVICE_HOSTNAME=api-catalog-services-2 - caching-service: - image: ghcr.io/zowe/caching-service:latest - discoverable-client: - image: ghcr.io/zowe/discoverable-client:latest - discoverable-client-2: - image: ghcr.io/zowe/discoverable-client:latest - environment: - - APIML_SERVICE_HOSTNAME=discoverable-client-2 - discovery-service: - image: ghcr.io/zowe/discovery-service:latest - volumes: - - ../../config/docker/api-defs-shared:/api-defs - ports: - - "10011:10011" - environment: - - APIML_DISCOVERY_ALLPEERSURLS=https://discovery-service:10011/eureka,https://discovery-service-2:10011/eureka - discovery-service-2: - image: ghcr.io/zowe/discovery-service:latest - volumes: - - ../../config/docker/api-defs-shared:/api-defs - environment: - - APIML_DISCOVERY_ALLPEERSURLS=https://discovery-service:10011/eureka,https://discovery-service-2:10011/eureka - - APIML_SERVICE_HOSTNAME=discovery-service-2 - gateway-service: - image: ghcr.io/zowe/gateway-service:latest - ports: - - "10010:10010" - environment: - - APIML_SERVICE_DISCOVERYSERVICEURLS=https://discovery-service:10011/eureka/,https://discovery-service-2:10011/eureka/ - gateway-service-2: - image: ghcr.io/zowe/gateway-service:latest - environment: - - APIML_SERVICE_HOSTNAME=gateway-service-2 - - SERVER_INTERNAL_PORT=10027 - - APIML_SERVICE_DISCOVERYSERVICEURLS=https://discovery-service:10011/eureka/,https://discovery-service-2:10011/eureka/ - mock-services: - image: ghcr.io/zowe/mock-services:latest diff --git a/docker/local-single/docker-compose.yml b/docker/local-single/docker-compose.yml deleted file mode 100644 index d9f75b535c..0000000000 --- a/docker/local-single/docker-compose.yml +++ /dev/null @@ -1,40 +0,0 @@ -version: "3.3" -services: - zaas-service: - image: ghcr.io/zowe/zaas-service:latest - ports: - - "10023:10023" - api-catalog-services: - image: ghcr.io/zowe/api-catalog-services:latest - volumes: - - ../../config/docker/api-defs-shared:/api-defs - ports: - - "10014:10014" - api-catalog-services-2: - image: ghcr.io/zowe/api-catalog-services-standalone:latest - volumes: - - ../../config/docker/api-defs-shared:/api-defs - ports: - - "10015:10015" - caching-service: - image: ghcr.io/zowe/caching-service:latest - ports: - - "10016:10016" - discoverable-client: - image: ghcr.io/zowe/discoverable-client:latest - ports: - - "10012:10012" - discovery-service: - image: ghcr.io/zowe/discovery-service:latest - volumes: - - ../../config/docker/api-defs-shared:/api-defs - ports: - - "10011:10011" - gateway-service: - image: ghcr.io/zowe/gateway-service:latest - ports: - - "10010:10010" - mock-services: - image: ghcr.io/zowe/mock-services:latest - ports: - - "10013:10013" diff --git a/docker/nginx/conf/load-balancer.conf b/docker/nginx/conf/load-balancer.conf deleted file mode 100644 index 04a12f7f2c..0000000000 --- a/docker/nginx/conf/load-balancer.conf +++ /dev/null @@ -1,47 +0,0 @@ -events { - worker_connections 4096; ## Default: 1024 -} - -http { -# Load balancing for simulating DVIPA on Gateway. It uses Round robin. -upstream backend { - server gateway-service; - server gateway-service-2; - server discovery-service; - server discovery-service-2; - server discoverable-client; - server discoverable-client-2; - server api-catalog-services; - server api-catalog-services-2; -} - -# This server accepts all traffic to port 10010 and passes it to the upstream. -# Notice that the upstream name and the proxy_pass need to match. - -server { - listen 443 ssl; - server_name localhost; - ssl_certificate /etc/ssl/private/localhost/localhost.keystore.cer; - ssl_certificate_key /etc/ssl/private/localhost/localhost.keystore.key; - ssl_client_certificate /etc/ssl/private/localhost/trusted_CAs.cer; - ssl_verify_client optional; - proxy_set_header Host $http_host; - location / { - proxy_pass http://backend; - proxy_http_version 1.1; - proxy_cache_bypass $http_upgrade; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-Port $server_port; - proxy_set_header X-SSL-CERT $ssl_client_escaped_cert; - proxy_buffer_size 128k; - proxy_buffers 4 256k; - proxy_busy_buffers_size 256k; - } -} -} diff --git a/docker/nginx/conf/nginx.conf b/docker/nginx/conf/nginx.conf deleted file mode 100644 index f8e59d443b..0000000000 --- a/docker/nginx/conf/nginx.conf +++ /dev/null @@ -1,123 +0,0 @@ -events { - worker_connections 4096; ## Default: 1024 -} -http { - -# Gateway service secure port for integration tests -server { -listen 10030 ssl; -server_name localhost; - ssl_certificate /etc/ssl/private/localhost/localhost.keystore.cer; - ssl_certificate_key /etc/ssl/private/localhost/localhost.keystore.key; - ssl_client_certificate /etc/ssl/private/localhost/trusted_CAs.cer; - ssl_verify_client optional; - location / { - proxy_pass http://host.docker.internal:10010; - proxy_http_version 1.1; - proxy_cache_bypass $http_upgrade; - - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-Port $server_port; - proxy_set_header X-SSL-CERT $ssl_client_escaped_cert; - proxy_buffer_size 128k; - proxy_buffers 4 256k; - proxy_busy_buffers_size 256k; - } -} - -# Full tunnel for discovery service to pass client certificate -server { -listen 9001 ssl; -server_name localhost; - ssl_certificate /etc/ssl/private/localhost/localhost.keystore.cer; - ssl_certificate_key /etc/ssl/private/localhost/localhost.keystore.key; - ssl_client_certificate /etc/ssl/private/localhost/localca.cer; - ssl_verify_client optional; - location / { - proxy_pass http://host.docker.internal:10011; - proxy_http_version 1.1; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-Port $server_port; - proxy_set_header X-SSL-CERT $ssl_client_escaped_cert; - proxy_buffer_size 128k; - proxy_buffers 4 256k; - proxy_busy_buffers_size 256k; - } -} - -server { -listen 10001 ; -server_name localhost; - location / { - proxy_pass https://localhost:9001; - proxy_http_version 1.1; - proxy_ssl_certificate /etc/ssl/private/localhost/Zowe_Service_Zowe_Development_Instances_Certificate_Authority_.cer; - proxy_ssl_certificate_key /etc/ssl/private/localhost/localhost.keystore.key; - proxy_ssl_trusted_certificate /etc/ssl/private/localhost/localca.cer; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-Port $server_port; - proxy_buffer_size 128k; - proxy_buffers 4 256k; - proxy_busy_buffers_size 256k; - } -} - -# Full tunnel for caching service to pass client certificate -server { -listen 9000 ssl; -server_name localhost; - ssl_certificate /etc/ssl/private/localhost/localhost.keystore.cer; - ssl_certificate_key /etc/ssl/private/localhost/localhost.keystore.key; - ssl_client_certificate /etc/ssl/private/localhost/localca.cer; - ssl_verify_client optional; - location / { - proxy_pass http://host.docker.internal:10006; - proxy_http_version 1.1; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-Port $server_port; - proxy_set_header X-SSL-CERT $ssl_client_escaped_cert; - proxy_buffer_size 128k; - proxy_buffers 4 256k; - proxy_busy_buffers_size 256k; - } -} - -server { -listen 10016 ; -server_name localhost; - location / { - proxy_pass https://localhost:9000; - proxy_http_version 1.1; - proxy_ssl_certificate /etc/ssl/private/localhost/Zowe_Service_Zowe_Development_Instances_Certificate_Authority_.cer; - proxy_ssl_certificate_key /etc/ssl/private/localhost/localhost.keystore.key; - proxy_ssl_trusted_certificate /etc/ssl/private/localhost/localca.cer; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-Port $server_port; - proxy_buffer_size 128k; - proxy_buffers 4 256k; - proxy_busy_buffers_size 256k; - } -} -} diff --git a/docker/nginx/docker-compose.yml b/docker/nginx/docker-compose.yml deleted file mode 100644 index 202145c667..0000000000 --- a/docker/nginx/docker-compose.yml +++ /dev/null @@ -1,17 +0,0 @@ -version: '3' - -services: - reverse: - container_name: reverse - hostname: reverse - image: nginx - ports: - - 10000:10000 - - 10001:10001 - - 10030:10030 - - 10016:10016 - volumes: - - ./conf:/etc/nginx - - ../../keystore:/etc/ssl/private - extra_hosts: - host.docker.internal: host-gateway