diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5ece8c1af..6948c4fc4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -210,6 +210,58 @@ jobs: echo "${VERSION}" make build-${{ matrix.dist }} + build-gpu-operator-bundle-image: + needs: [go-check, go-test, go-build] + # SHIVA could be only branch=release + if: github.ref_type == 'branch' # # Runs only if the event is from a branch commit + runs-on: ubuntu-latest + strategy: + matrix: + dist: [ubi9] + steps: + - uses: actions/checkout@v4 + name: Check out code + - name: Calculate build vars + id: vars + run: | + echo "COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}" >> $GITHUB_ENV + echo "LOWERCASE_REPO_OWNER=$(echo "${GITHUB_REPOSITORY_OWNER}" | awk '{print tolower($0)}')" >> $GITHUB_ENV + REPO_FULL_NAME="${{ github.event.pull_request.head.repo.full_name }}" + echo "${REPO_FULL_NAME}" + echo "LABEL_IMAGE_SOURCE=https://github.com/${REPO_FULL_NAME}" >> $GITHUB_ENV + + GENERATE_ARTIFACTS="false" + if [[ "${{ github.actor }}" == "dependabot[bot]" ]]; then + GENERATE_ARTIFACTS="false" + elif [[ "${{ github.event_name }}" == "pull_request" && "${{ github.event.pull_request.head.repo.full_name }}" == "${{ github.repository }}" ]]; then + GENERATE_ARTIFACTS="true" + elif [[ "${{ github.event_name }}" == "push" ]]; then + GENERATE_ARTIFACTS="true" + fi + echo "PUSH_ON_BUILD=${GENERATE_ARTIFACTS}" >> $GITHUB_ENV + echo "BUILD_MULTI_ARCH_IMAGES=${GENERATE_ARTIFACTS}" >> $GITHUB_ENV + echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + image: tonistiigi/binfmt:master + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build image + env: + # BUNDLE_IMAGE: "${CI_REGISTRY_IMAGE}/staging/gpu-operator-bundle:${CI_COMMIT_BRANCH}-latest" + BUNDLE_IMAGE: "ghcr.io/staging/gpu-operator-bundle:${{ BRANCH_NAME }}-latest" + DEFAULT_CHANNEL: "stable" + CHANNELS: "stable" + run: | + make push-bundle-image + ### e2e tests ### e2e-tests-containerd: needs: [build-gpu-operator, build-gpu-operator-validator] diff --git a/Makefile b/Makefile index ee7eaabcf..fe82b1026 100644 --- a/Makefile +++ b/Makefile @@ -140,7 +140,7 @@ build-bundle-image: $(DOCKER) build \ --build-arg VERSION=$(VERSION) \ --build-arg DEFAULT_CHANNEL=$(DEFAULT_CHANNEL) \ - --build-arg GIT_COMMIT=$(GIT_COMMIT) \ + --build-arg GIT_COMMIT=$(GITHUB_SHA) \ -f docker/bundle.Dockerfile -t $(BUNDLE_IMAGE) . # Push the bundle image. diff --git a/tigera2.yaml b/tigera2.yaml new file mode 100644 index 000000000..a1141d403 --- /dev/null +++ b/tigera2.yaml @@ -0,0 +1,27 @@ +# This section includes base Calico installation configuration. +# For more information, see: https://docs.tigera.io/calico/latest/reference/installation/api#operator.tigera.io/v1.Installation +apiVersion: operator.tigera.io/v1 +kind: Installation +metadata: + name: default +spec: + # Configures Calico networking. + calicoNetwork: + ipPools: + - name: default-ipv4-ippool + blockSize: 26 + cidr: 192.168.0.0/16 + encapsulation: VXLANCrossSubnet + natOutgoing: Enabled + nodeSelector: all() + +--- + +# This section configures the Calico API server. +# For more information, see: https://docs.tigera.io/calico/latest/reference/installation/api#operator.tigera.io/v1.APIServer +apiVersion: operator.tigera.io/v1 +kind: APIServer +metadata: + name: default +spec: {} +