From 30487947b95ea99fa4d3a8f3a2c7ae0b3a474778 Mon Sep 17 00:00:00 2001 From: Pierre Millot Date: Sat, 28 Dec 2024 13:55:30 +0100 Subject: [PATCH] feat(byoc): only use shortname in the source input --- scripts/docker/Dockerfile.base | 26 ++++++++-------- scripts/docker/Dockerfile.ruby | 4 +-- scripts/docker/Dockerfile.swift | 10 +++--- specs/ingestion/common/schemas/source.yml | 38 ++--------------------- 4 files changed, 22 insertions(+), 56 deletions(-) diff --git a/scripts/docker/Dockerfile.base b/scripts/docker/Dockerfile.base index 19fa643ee8f..5a9abe61bd4 100644 --- a/scripts/docker/Dockerfile.base +++ b/scripts/docker/Dockerfile.base @@ -15,21 +15,21 @@ SHELL ["/bin/bash", "--login", "-c"] # Global dependencies RUN apt-get update \ - && apt-get install -y --no-install-recommends git curl zip unzip libexpat1-dev \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && apt-get install -y --no-install-recommends git curl zip unzip libexpat1-dev \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* COPY .nvmrc .nvmrc RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash && source ~/.profile \ - && nvm install \ - && npm install -g yarn + && nvm install \ + && npm install -g yarn # SDKMAN ARG JAVA_VERSION RUN curl -s "https://get.sdkman.io" | bash RUN source "/root/.sdkman/bin/sdkman-init.sh" \ - && sdk install java ${JAVA_VERSION}-tem \ - && sdk install sbt + && sdk install java ${JAVA_VERSION}-tem \ + && sdk install sbt # Java formatter ADD https://github.com/google/google-java-format/releases/download/v1.25.2/google-java-format-1.25.2-all-deps.jar /tmp/java-formatter.jar @@ -39,9 +39,9 @@ ADD https://github.com/google/google-java-format/releases/download/v1.25.2/googl COPY --from=python-builder /usr/local/bin/ /usr/local/bin/ COPY --from=python-builder /usr/local/lib/ /usr/local/lib/ RUN echo "export PATH=$PATH:/usr/local/bin/python" >> ~/.profile \ - && echo "export PATH=$PATH:/usr/local/bin/pip" >> ~/.profile \ - && pip install --upgrade pip pipx && pipx ensurepath \ - && pipx install poetry + && echo "export PATH=$PATH:/usr/local/bin/pip" >> ~/.profile \ + && pip install --upgrade pip pipx && pipx ensurepath \ + && pipx install poetry ENV VIRTUAL_ENV=/opt/env RUN python -m venv $VIRTUAL_ENV ENV PATH="$VIRTUAL_ENV/bin:$PATH" @@ -49,14 +49,14 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH" # Go COPY --from=go-builder /usr/local/go/ /usr/local/go/ RUN echo "export PATH=$PATH:/usr/local/go/bin:/root/go/bin" >> ~/.profile && source ~/.profile \ - && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.60.3 \ - && go install golang.org/x/tools/cmd/goimports@v0.22.0 + && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.60.3 \ + && go install golang.org/x/tools/cmd/goimports@v0.22.0 # Dart COPY --from=dart-builder /usr/lib/dart/ /usr/lib/dart/ RUN echo "export PATH=/usr/lib/dart/bin:/root/.pub-cache/bin:$PATH" >> ~/.profile && source ~/.profile \ - && dart pub global activate melos + && dart pub global activate melos # PHP COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer diff --git a/scripts/docker/Dockerfile.ruby b/scripts/docker/Dockerfile.ruby index 298e267c353..782d855499d 100644 --- a/scripts/docker/Dockerfile.ruby +++ b/scripts/docker/Dockerfile.ruby @@ -3,7 +3,7 @@ FROM ruby:${RUBY_VERSION}-bullseye ADD https://github.com/fables-tales/rubyfmt/releases/download/v0.10.0/rubyfmt-v0.10.0-Linux-aarch64.tar.gz rubyfmt.tar.gz RUN tar -xzf rubyfmt.tar.gz && \ - mv tmp/releases/v0.10.0-Linux/rubyfmt /usr/local/bin && \ - rm -rf rubyfmt.tar.gz tmp + mv tmp/releases/v0.10.0-Linux/rubyfmt /usr/local/bin && \ + rm -rf rubyfmt.tar.gz tmp WORKDIR /app diff --git a/scripts/docker/Dockerfile.swift b/scripts/docker/Dockerfile.swift index 8f3d491bd8d..532ae1e698e 100644 --- a/scripts/docker/Dockerfile.swift +++ b/scripts/docker/Dockerfile.swift @@ -1,15 +1,15 @@ ARG SWIFT_VERSION ARG SWIFTFORMAT_VERSION=0.54.5 -FROM ghcr.io/nicklockwood/swiftformat:${SWIFTFORMAT_VERSION} AS swiftFormat +FROM ghcr.io/nicklockwood/swiftformat:${SWIFTFORMAT_VERSION} AS swift_format FROM swift:${SWIFT_VERSION}-jammy -COPY --from=swiftFormat /usr/bin/swiftformat /usr/bin/swiftformat +COPY --from=swift_format /usr/bin/swiftformat /usr/bin/swiftformat # Global dependencies RUN apt-get update \ - && apt-get install -y --no-install-recommends zlib1g-dev \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && apt-get install -y --no-install-recommends zlib1g-dev \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* WORKDIR /app diff --git a/specs/ingestion/common/schemas/source.yml b/specs/ingestion/common/schemas/source.yml index 5703c1c952e..e5725a37a45 100644 --- a/specs/ingestion/common/schemas/source.yml +++ b/specs/ingestion/common/schemas/source.yml @@ -343,48 +343,24 @@ SourceDocker: type: object additionalProperties: false properties: - imageType: - $ref: '#/DockerImageType' - registry: - $ref: '#/DockerRegistry' image: type: string - description: Docker image name. - example: algolia/zendesk - version: - type: string - description: Docker image version. - default: latest - example: v2.1.0 + description: Shortname of the image, as returned by the referential. + example: zendesk configuration: type: object description: Configuration of the spec. required: - - registry - image - - imageType - configuration x-discriminator-fields: - - registry - image - - imageType - configuration SourceUpdateDocker: type: object additionalProperties: false properties: - registry: - $ref: '#/DockerRegistry' - image: - type: string - description: Docker image name. - example: algolia/zendesk - version: - type: string - description: Docker image version. - default: latest - example: v2.1.0 configuration: type: object description: Configuration of the spec. @@ -393,16 +369,6 @@ SourceUpdateDocker: x-discriminator-fields: - configuration -DockerRegistry: - type: string - description: Container registry name from where to pull the image. - enum: [dockerhub, ghcr] - -DockerImageType: - type: string - enum: [custom, airbyte] - description: Image type. - SourceInput: oneOf: - $ref: '#/SourceCommercetools'