Skip to content

Commit

Permalink
fix: Re-apply rootless containers and fix ESP configs (#11731)
Browse files Browse the repository at this point in the history
  • Loading branch information
perangel committed Mar 20, 2024
1 parent 404ac8f commit 4836e3b
Show file tree
Hide file tree
Showing 36 changed files with 305 additions and 110 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ CONFIGS_DATABASE_MINIMUM_FLYWAY_MIGRATION_VERSION=0.40.23.002
TEMPORAL_HOST=airbyte-temporal:7233
INTERNAL_API_HOST=airbyte-server:8001
INTERNAL_API_URL=http://airbyte-server:8001
CONNECTOR_BUILDER_API_HOST=airbyte-connector-builder-server:80
CONNECTOR_BUILDER_API_HOST=airbyte-connector-builder-server:8080
WEBAPP_URL=http://localhost:8000/
WORKLOAD_API_HOST=workload-api-server:8007
WORKLOAD_API_URL=http://workload-api-server:8007
# Although not present as an env var, required for webapp configuration.
CONNECTOR_BUILDER_API_URL=/connector-builder-api
AIRBYTE_API_HOST=airbyte-api-server:8006
CONNECTOR_BUILDER_SERVER_API_HOST=http://airbyte-connector-builder-server:80
CONNECTOR_BUILDER_SERVER_API_HOST=http://airbyte-connector-builder-server:8080
# Replace with the commented-out line below to use a locally-run connector-builder-server
# image, e.g. when developing the CDK's builder server command runner.
# CONNECTOR_BUILDER_SERVER_API_HOST=http://host.docker.internal:80
Expand Down
6 changes: 5 additions & 1 deletion airbyte-api-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
ARG JDK_IMAGE=airbyte/airbyte-base-java-image:3.0.1
ARG JDK_IMAGE=airbyte/airbyte-base-java-image:3.1.0
FROM ${JDK_IMAGE} AS server
EXPOSE 8006 5005
ENV APPLICATION airbyte-api-server
ENV VERSION ${VERSION}

WORKDIR /app

# This is automatically unzipped by Docker
USER root
ADD airbyte-app.tar /app
RUN chown -R airbyte:airbyte /app
USER airbyte:airbyte

# wait for upstream dependencies to become available before starting server
ENTRYPOINT ["/bin/bash", "-c", "airbyte-app/bin/${APPLICATION}"]
13 changes: 0 additions & 13 deletions airbyte-base-java-python-image/Dockerfile

This file was deleted.

8 changes: 7 additions & 1 deletion airbyte-bootloader/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
ARG JDK_IMAGE=airbyte/airbyte-base-java-image:3.0.1
ARG JDK_IMAGE=airbyte/airbyte-base-java-image:3.1.0
FROM ${JDK_IMAGE}

WORKDIR /app

USER root
ADD airbyte-app.tar /app
RUN chown -R airbyte:airbyte /app
USER airbyte:airbyte

ENTRYPOINT ["/bin/bash", "-c", "airbyte-app/bin/airbyte-bootloader"]
2 changes: 1 addition & 1 deletion airbyte-config/init/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG ALPINE_IMAGE=alpine:3.13
ARG ALPINE_IMAGE=alpine:3.18
FROM ${ALPINE_IMAGE} AS seed

WORKDIR /app
Expand Down
7 changes: 5 additions & 2 deletions airbyte-connector-builder-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BASE_IMAGE=airbyte/airbyte-base-java-python-image:1.1.0
FROM ${BASE_IMAGE} AS connector-builder-server
ARG JAVA_PYTHON_BASE_IMAGE_VERSION=2.1.0
FROM airbyte/airbyte-base-java-python-image:${JAVA_PYTHON_BASE_IMAGE_VERSION} AS connector-builder-server

# Set up CDK requirements
ARG CDK_VERSION=0.65.0
Expand All @@ -18,7 +18,10 @@ ENV VERSION ${VERSION}
WORKDIR /app

# This is automatically unzipped by Docker
USER root
ADD airbyte-app.tar /app
RUN chown -R airbyte:airbyte /app
USER airbyte:airbyte

# wait for upstream dependencies to become available before starting server
ENTRYPOINT ["/bin/bash", "-c", "airbyte-app/bin/${APPLICATION}"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ micronaut:
authentication-provider-strategy: ALL
enabled: ${API_AUTHORIZATION_ENABLED:false}
server:
port: 80
port: 8080
cors:
enabled: true
netty:
Expand Down
8 changes: 5 additions & 3 deletions airbyte-connector-sidecar/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM amazoncorretto:21 AS connector-sidecar
ARG JAVA_WORKER_BASE_IMAGE_VERSION=2.1.0
FROM airbyte/airbyte-base-java-worker-image:${JAVA_WORKER_BASE_IMAGE_VERSION}

ARG DOCKER_BUILD_ARCH=amd64

Expand All @@ -8,12 +9,13 @@ ARG VERSION=dev
ENV APPLICATION airbyte-connector-sidecar
ENV VERSION=${VERSION}

WORKDIR /app

USER root
COPY WellKnownTypes.json /app

# Move connector-sidecar app
ADD airbyte-app.tar /app
RUN chown -R airbyte:airbyte /app
USER airbyte:airbyte

# wait for upstream dependencies to become available before starting server
ENTRYPOINT ["/bin/bash", "-c", "/app/airbyte-app/bin/${APPLICATION}"]
6 changes: 5 additions & 1 deletion airbyte-container-orchestrator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM airbyte/airbyte-base-java-worker-image:2.0.1
ARG JAVA_WORKER_BASE_IMAGE_VERSION=2.1.0
FROM airbyte/airbyte-base-java-worker-image:${JAVA_WORKER_BASE_IMAGE_VERSION}

# Don't change this manually. Bump version expects to make moves based on this string
ARG VERSION=dev
Expand All @@ -8,10 +9,13 @@ ENV VERSION=${VERSION}

WORKDIR /app

USER root
COPY WellKnownTypes.json /app

# Move orchestrator app
ADD airbyte-app.tar /app
RUN chown -R airbyte:airbyte /app
USER airbyte:airbyte

# wait for upstream dependencies to become available before starting server
ENTRYPOINT ["/bin/bash", "-c", "/app/airbyte-app/bin/${APPLICATION}"]
8 changes: 7 additions & 1 deletion airbyte-cron/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
ARG JDK_IMAGE=airbyte/airbyte-base-java-image:3.0.1
ARG JDK_IMAGE=airbyte/airbyte-base-java-image:3.1.0
FROM ${JDK_IMAGE}

WORKDIR /app

USER root
ADD airbyte-app.tar /app
RUN chown -R airbyte:airbyte /app
USER airbyte:airbyte

ENTRYPOINT ["/bin/bash", "-c", "airbyte-app/bin/airbyte-cron"]
8 changes: 7 additions & 1 deletion airbyte-keycloak-setup/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
ARG JDK_IMAGE=airbyte/airbyte-base-java-image:3.0.1
ARG JDK_IMAGE=airbyte/airbyte-base-java-image:3.1.0
FROM ${JDK_IMAGE} AS keycloak-setup

WORKDIR /app

USER root
ADD airbyte-app.tar /app
RUN chown -R airbyte:airbyte /app
USER airbyte:airbyte

ENTRYPOINT ["/bin/bash", "-c", "airbyte-app/bin/airbyte-keycloak-setup"]
8 changes: 7 additions & 1 deletion airbyte-metrics/reporter/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
ARG JDK_IMAGE=airbyte/airbyte-base-java-image:3.0.1
ARG JDK_IMAGE=airbyte/airbyte-base-java-image:3.1.0
FROM ${JDK_IMAGE}

WORKDIR /app

USER root
ADD airbyte-app.tar /app
RUN chown -R airbyte:airbyte /app
USER airbyte:airbyte

ENTRYPOINT ["/bin/bash", "-c", "airbyte-app/bin/airbyte-metrics-reporter"]
4 changes: 2 additions & 2 deletions airbyte-proxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ ENV VERSION ${VERSION}
RUN apt-get update -y && apt-get install -y apache2-utils && rm -rf /var/lib/apt/lists/*

# This variable can be used to update the destination containers that Nginx proxies to.
ENV PROXY_PASS_WEB "http://airbyte-webapp:80"
ENV PROXY_PASS_WEB "http://airbyte-webapp:8080"
ENV PROXY_PASS_API "http://airbyte-server:8001"
ENV CONNECTOR_BUILDER_SERVER_API "http://airbyte-connector-builder-server:80"
ENV CONNECTOR_BUILDER_SERVER_API "http://airbyte-connector-builder-server:8080"
ENV PROXY_PASS_AIRBYTE_API_SERVER "http://airbyte-api-server:8006"

# Nginx config file
Expand Down
5 changes: 4 additions & 1 deletion airbyte-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG JDK_IMAGE=airbyte/airbyte-base-java-image:3.0.1
ARG JDK_IMAGE=airbyte/airbyte-base-java-image:3.1.0
FROM ${JDK_IMAGE} AS server

EXPOSE 8000 5005
Expand All @@ -11,7 +11,10 @@ ENV VERSION ${VERSION}
WORKDIR /app

# This is automatically unzipped by Docker
USER root
ADD airbyte-app.tar /app
RUN chown -R airbyte:airbyte /app
USER airbyte:airbyte

# wait for upstream dependencies to become available before starting server
ENTRYPOINT ["/bin/bash", "-c", "airbyte-app/bin/${APPLICATION}"]
10 changes: 8 additions & 2 deletions airbyte-webapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
ARG NGINX_IMAGE=nginx:alpine
ARG NGINX_IMAGE=nginxinc/nginx-unprivileged:alpine3.18
FROM ${NGINX_IMAGE}

EXPOSE 80
EXPOSE 8080

USER root

COPY bin/build /usr/share/nginx/html
RUN find /usr/share/nginx/html -type d -exec chmod 755 '{}' \; -o -type f -exec chmod 644 '{}' \;
COPY bin/nginx/default.conf.template /etc/nginx/templates/default.conf.template

RUN chown -R nginx:nginx /usr/share/nginx/html

USER nginx:nginx
2 changes: 1 addition & 1 deletion airbyte-webapp/Dockerfile.cloud
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG NGINX_IMAGE=nginx:alpine
ARG NGINX_IMAGE=nginxinc/nginx-unprivileged:alpine3.18
FROM ${NGINX_IMAGE}

COPY build/app /usr/share/nginx/html
Expand Down
4 changes: 2 additions & 2 deletions airbyte-webapp/nginx/cloud.conf.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
server {
listen 80;
listen [::]:80;
listen 8080;
listen [::]:8080;
server_name localhost;

gzip on;
Expand Down
4 changes: 2 additions & 2 deletions airbyte-webapp/nginx/default.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ upstream keycloak {
}

server {
listen 80;
listen [::]:80;
listen 8080;
listen [::]:8080;
server_name localhost;

add_header Content-Security-Policy "script-src * 'unsafe-inline'; worker-src 'self' blob:;";
Expand Down
5 changes: 3 additions & 2 deletions airbyte-webapp/release.dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
ARG BUILD_IMAGE
FROM ${BUILD_IMAGE} AS builder
ARG NGINX_IMAGE=nginxinc/nginx-unprivileged:alpine3.18

FROM ${BUILD_IMAGE} AS builder

FROM nginx:alpine AS release
FROM ${NGINX_IMAGE}

EXPOSE 80

Expand Down
6 changes: 5 additions & 1 deletion airbyte-workers/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
FROM airbyte/airbyte-base-java-worker-image:2.0.1
ARG JAVA_WORKER_BASE_IMAGE_VERSION=2.1.0
FROM airbyte/airbyte-base-java-worker-image:${JAVA_WORKER_BASE_IMAGE_VERSION}

ENV APPLICATION airbyte-workers
ENV VERSION ${VERSION}

WORKDIR /app

USER root
COPY WellKnownTypes.json /app

# Move worker app
ADD airbyte-app.tar /app
RUN chown -R airbyte:airbyte /app
USER airbyte:airbyte

EXPOSE 5005

Expand Down
5 changes: 4 additions & 1 deletion airbyte-workload-api-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
ARG JDK_IMAGE=airbyte/airbyte-base-java-image:3.0.1
ARG JDK_IMAGE=airbyte/airbyte-base-java-image:3.1.0
FROM ${JDK_IMAGE} AS server
EXPOSE 8007 5005
ENV APPLICATION airbyte-workload-api-server
ENV VERSION ${VERSION}
WORKDIR /app

# This is automatically unzipped by Docker
USER root
ADD airbyte-app.tar /app
RUN chown -R airbyte:airbyte /app
USER airbyte:airbyte

# wait for upstream dependencies to become available before starting server
ENTRYPOINT ["/bin/bash", "-c", "airbyte-app/bin/${APPLICATION}"]
6 changes: 5 additions & 1 deletion airbyte-workload-launcher/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
FROM airbyte/airbyte-base-java-worker-image:2.0.1
ARG JAVA_WORKER_BASE_IMAGE_VERSION=2.1.0
FROM airbyte/airbyte-base-java-worker-image:${JAVA_WORKER_BASE_IMAGE_VERSION}

ENV APPLICATION airbyte-workload-launcher
ENV VERSION ${VERSION}

WORKDIR /app

# This is automatically unzipped by Docker
USER root
ADD airbyte-app.tar /app
RUN chown -R airbyte:airbyte /app
USER airbyte:airbyte

# 8016 is the port micronaut listens on
# 5005 is the remote debug port
Expand Down
14 changes: 6 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ buildscript {
plugins {
id "base"
id "com.dorongold.task-tree" version "2.1.1"
id "io.airbyte.gradle.jvm" version "0.28.0" apply false
id "io.airbyte.gradle.jvm.app" version "0.28.0" apply false
id "io.airbyte.gradle.jvm.lib" version "0.28.0" apply false
id "io.airbyte.gradle.docker" version "0.28.0" apply false
id "io.airbyte.gradle.publish" version "0.28.0" apply false
id "io.airbyte.gradle.jvm" version "0.31.0" apply false
id "io.airbyte.gradle.jvm.app" version "0.31.0" apply false
id "io.airbyte.gradle.jvm.lib" version "0.31.0" apply false
id "io.airbyte.gradle.docker" version "0.31.0" apply false
id "io.airbyte.gradle.publish" version "0.31.0" apply false
// uncomment for testing plugin locally
// id "io.airbyte.gradle.jvm" version "local-test" apply false
// id "io.airbyte.gradle.jvm.app" version "local-test" apply false
Expand Down Expand Up @@ -158,17 +158,15 @@ subprojects { sp ->
def buildArch = System.getenv('DOCKER_BUILD_ARCH') ?: isArm64 ? 'arm64' : 'amd64'
def buildPlatform = System.getenv('DOCKER_BUILD_PLATFORM') ?: isArm64 ? 'linux/arm64' : 'linux/amd64'
def alpineImage = System.getenv('ALPINE_IMAGE') ?: isArm64 ? 'arm64v8/alpine:3.14' : 'amd64/alpine:3.14'
def nginxImage = System.getenv('NGINX_IMAGE') ?: isArm64 ? 'arm64v8/nginx:alpine' : 'amd64/nginx:alpine'

// Used by the platform -- Must be an Amazon Corretto-based image for build to work without modification to Dockerfile instructions
def openjdkImage = System.getenv('JDK_IMAGE') ?: 'airbyte/airbyte-base-java-image:3.0.1'
def openjdkImage = System.getenv('JDK_IMAGE') ?: 'airbyte/airbyte-base-java-image:3.1.0'

platform = buildPlatform
images.add("airbyte/$sp.dockerImageName:$rootProject.ext.image_tag")
buildArgs.put('JDK_VERSION', jdkVersion)
buildArgs.put('DOCKER_BUILD_ARCH', buildArch)
buildArgs.put('ALPINE_IMAGE', alpineImage)
buildArgs.put('NGINX_IMAGE', nginxImage)
buildArgs.put('JDK_IMAGE', openjdkImage)
buildArgs.put('VERSION', rootProject.ext.version)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ spec:

ports:
- name: http
containerPort: 80
containerPort: 8080
protocol: TCP
{{- if .Values.debug.enabled }}
- name: debug
Expand Down
2 changes: 1 addition & 1 deletion charts/airbyte-webapp/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ spec:
{{- end }}
ports:
- name: http
containerPort: 80
containerPort: 8080
protocol: TCP
{{- if .Values.resources }}
resources: {{- toYaml .Values.resources | nindent 10 }}
Expand Down
Loading

0 comments on commit 4836e3b

Please sign in to comment.