From 29cb954639d45fbdfc0fece22ab89067d3c07d7b Mon Sep 17 00:00:00 2001 From: Alexander Petric Date: Wed, 16 Oct 2024 08:36:36 -0400 Subject: [PATCH] rhel9 build workflow (#4528) * dockerfile for rhel9 * attach rh to release page workflow * changing name * updating new workflow * updating new workflow * pushing new workflow * trigger workflow * trigger workflow * trigger workflow * trigger workflow * finished workflow * ellipsis comment --- .github/workflows/build-publish-rh-image.yml | 128 +++++++++++++++++++ docker/RHEL9/Dockerfile | 8 +- docker/RHEL9/README.md | 21 ++- 3 files changed, 143 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/build-publish-rh-image.yml diff --git a/.github/workflows/build-publish-rh-image.yml b/.github/workflows/build-publish-rh-image.yml new file mode 100644 index 0000000000..b957ac5148 --- /dev/null +++ b/.github/workflows/build-publish-rh-image.yml @@ -0,0 +1,128 @@ +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +name: Build and publish windmill for RHEL9 +on: + workflow_dispatch + +permissions: write-all + +jobs: + build_ee: + runs-on: ubicloud + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Read EE repo commit hash + run: | + echo "ee_repo_ref=$(cat ./backend/ee-repo-ref.txt)" >> "$GITHUB_ENV" + + - uses: actions/checkout@v4 + with: + repository: windmill-labs/windmill-ee-private + path: ./windmill-ee-private + ref: ${{ env.ee_repo_ref }} + token: ${{ secrets.WINDMILL_EE_PRIVATE_ACCESS }} + fetch-depth: 0 + + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v2 + - uses: depot/setup-action@v1 + + - name: Docker meta + id: meta-ee-public + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee-rhel9 + flavor: | + latest=false + tags: | + type=sha + + - name: Login to registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Substitute EE code + run: | + ./backend/substitute_ee_code.sh --copy --dir ./windmill-ee-private + + - name: Copy RHEL9 Dockerfile + run: | + cp ./docker/RHEL9/Dockerfile ./Dockerfile + + - name: Build and push publicly ee amd64 + uses: depot/build-push-action@v1 + with: + context: . + platforms: linux/amd64 + push: true + build-args: | + features=enterprise,enterprise_saml,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,deno_core + secrets: | + rh_username=${{ secrets.RH_USERNAME }} + rh_password=${{ secrets.RH_PASSWORD }} + tags: | + ${{ steps.meta-ee-public.outputs.tags }}-amd64 + labels: | + ${{ steps.meta-ee-public.outputs.labels }}-amd64 + org.opencontainers.image.licenses=Windmill-Enterprise-License + + - name: Build and push publicly ee arm64 + uses: depot/build-push-action@v1 + with: + context: . + platforms: linux/arm64 + push: true + build-args: | + features=enterprise,enterprise_saml,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,deno_core + secrets: | + rh_username=${{ secrets.RH_USERNAME }} + rh_password=${{ secrets.RH_PASSWORD }} + tags: | + ${{ steps.meta-ee-public.outputs.tags }}-arm64 + labels: | + ${{ steps.meta-ee-public.outputs.labels }}-arm64 + org.opencontainers.image.licenses=Windmill-Enterprise-License + + - uses: shrink/actions-docker-extract@v3 + id: extract-ee-amd64 + with: + image: ${{ steps.meta-ee-public.outputs.tags}}-amd64 + path: "/windmill/target/release/windmill" + + - uses: shrink/actions-docker-extract@v3 + id: extract-ee-arm64 + with: + image: ${{ steps.meta-ee-public.outputs.tags}}-arm64 + path: "/windmill/target/release/windmill" + + - name: Rename binary with corresponding architecture + run: | + mv "${{ steps.extract-ee-amd64.outputs.destination }}/windmill" "${{ steps.extract-ee-amd64.outputs.destination }}/windmill-ee-amd64-rhel9" + mv "${{ steps.extract-ee-arm64.outputs.destination }}/windmill" "${{ steps.extract-ee-arm64.outputs.destination }}/windmill-ee-arm64-rhel9" + + - uses: actions/upload-artifact@v4 + with: + name: RHEL9-amd64 build + path: ${{ steps.extract-ee-amd64.outputs.destination }}/windmill-ee-amd64-rhel9 + + - uses: actions/upload-artifact@v4 + with: + name: RHEL9-arm64 build + path: ${{ steps.extract-ee-arm64.outputs.destination }}/windmill-ee-arm64-rhel9 + + # - name: Attach binary to release + # uses: softprops/action-gh-release@v2 + # if: startsWith(github.ref, 'refs/tags/') + # with: + # files: | + # ${{ steps.extract-ee-arm64.outputs.destination }}/windmill-ee-arm64-rhel9 + # ${{ steps.extract-ee-amd64.outputs.destination }}/windmill-ee-amd64-rhel9 diff --git a/docker/RHEL9/Dockerfile b/docker/RHEL9/Dockerfile index 3a9ed24bb6..10e0f01096 100644 --- a/docker/RHEL9/Dockerfile +++ b/docker/RHEL9/Dockerfile @@ -4,11 +4,13 @@ ARG PYTHON_IMAGE=python:3.11.10-slim-bookworm FROM ${RUST_IMAGE} AS rust_base -RUN yum install -y rust-toolset - RUN yum update -y && \ yum install -y git openssl-devel npm nodejs rustfmt +# Install rust manually +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +ENV PATH="/root/.cargo/bin:${PATH}" + RUN CARGO_NET_GIT_FETCH_WITH_CLI=true cargo install cargo-chef --version ^0.1 WORKDIR /windmill @@ -35,7 +37,7 @@ COPY /backend/parsers/windmill-parser-wasm/pkg/ /backend/parsers/windmill-parser COPY /typescript-client/docs/ /frontend/static/tsdocs/ RUN npm run generate-backend-client -ENV NODE_OPTIONS "--max-old-space-size=8192" +ENV NODE_OPTIONS "--max-old-space-size=10240" RUN npm run build diff --git a/docker/RHEL9/README.md b/docker/RHEL9/README.md index af858d8be5..17d39b86ca 100644 --- a/docker/RHEL9/README.md +++ b/docker/RHEL9/README.md @@ -3,17 +3,16 @@ This directory contains the Dockerfiles for building Windmill binaries for Red Hat Linux 9. We build Windmill on the Red Hat Universal Base Image 9. Windmill requires the xmlsec1-devel package which is not available in the default UBI9 repositories. It is however included in the CodeReady Builder for RHEL9 repository which requires a RedHat subscription. -Moreover, only rust v1.75 is supported on Red Hat Linux 9. To make Windmill compatible with Rust v1.75, you need to pin the following libraries: -``` -aws-config = "=1.4.0" -aws-sdk-sts = "=1.25.0" -aws-sdk-ssooidc = "=1.25.0" -aws-sdk-sso = "=1.25.0" -``` - -Make sure to include `aws-sdk-ssooidc` and `aws-sdk-sso` in the Cargo.toml of windmill-common as well to enforce the correct versions of the nested dependencies. Make them optional and include them in the `parquet` feature. -It's also possible that you need to add `#[async_recursion]` to the `lock_modules` function in the `backend/windmill-worker/src/worker_lockfiles.rs` file for it to compile. Once the image is built, you can simply copy the binary on any Red Hat Linux 9 machine and run it. You will just need to install the xmlsec1 package which can be installed directly using `yum/dnf install xmlsec1`. - +## Notes + - you will need to register on Red Hat and have an individual developer subscription and pass the username and password to docker build: + ``` + docker build \ + -f docker/RHEL9/Dockerfile \ + --build-arg features="$features" \ + --secret id=rh_username,src=/path/to/rh_username \ + --secret id=rh_password,src=/path/to/rh_password \ + . + ``` \ No newline at end of file