From 2cac5ac59524201e08880d48c93263be225ba602 Mon Sep 17 00:00:00 2001 From: Michael Freeman Date: Tue, 25 Feb 2025 10:20:57 -0600 Subject: [PATCH 1/2] testing workflow --- .github/workflows/container-build.yml | 64 +++------------------------ 1 file changed, 6 insertions(+), 58 deletions(-) diff --git a/.github/workflows/container-build.yml b/.github/workflows/container-build.yml index 5776aef..4259092 100644 --- a/.github/workflows/container-build.yml +++ b/.github/workflows/container-build.yml @@ -1,4 +1,3 @@ -# .github/workflows/container-build.yml name: Build and Push Containers on: push: @@ -32,31 +31,9 @@ jobs: with: go-version: '1.24' - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - cache: 'npm' - cache-dependency-path: 'web/package-lock.json' - - - name: Install build dependencies - run: | - sudo apt-get update - sudo apt-get install -y libsqlite3-dev gcc - - name: Setup ko uses: ko-build/setup-ko@v0.6 - - name: Build web UI - run: ./scripts/build-web.sh - - - name: Move web artifacts - run: | - mkdir -p pkg/cloud/api/web/ - cp -r web/dist pkg/cloud/api/web/ - mkdir -p cmd/cloud/.kodata - cp -r web/dist cmd/cloud/.kodata/web - - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: @@ -66,44 +43,15 @@ jobs: - name: Build and push container images run: | - # Common tag variables SHA_TAG=sha-${{ steps.vars.outputs.sha_short }} - - # Build agent + echo "Pushing to ${{ env.BASE_REPO }}/serviceradar-agent" cd cmd/agent KO_DOCKER_REPO=${{ env.BASE_REPO }}/serviceradar-agent GOFLAGS="-tags=containers" ko build \ - --platform=linux/amd64,linux/arm64 \ - --tags=${SHA_TAG},latest \ - --bare . - cd ../.. - - # Build poller - cd cmd/poller - KO_DOCKER_REPO=${{ env.BASE_REPO }}/serviceradar-poller GOFLAGS="-tags=containers" ko build \ - --platform=linux/amd64,linux/arm64 \ - --tags=${SHA_TAG},latest \ - --bare . - cd ../.. - - # Build cloud (with CGO enabled) - cd cmd/cloud - CGO_ENABLED=1 KO_DOCKER_REPO=${{ env.BASE_REPO }}/serviceradar-cloud GOFLAGS="-tags=containers" ko build \ --platform=linux/amd64 \ --tags=${SHA_TAG},latest \ - --bare . + --bare --verbose . cd ../.. - - # Build dusk checker - cd cmd/checkers/dusk - KO_DOCKER_REPO=${{ env.BASE_REPO }}/serviceradar-dusk-checker GOFLAGS="-tags=containers" ko build \ - --platform=linux/amd64,linux/arm64 \ - --tags=${SHA_TAG},latest \ - --bare . - cd ../../.. - - # Build snmp checker - cd cmd/checkers/snmp - KO_DOCKER_REPO=${{ env.BASE_REPO }}/serviceradar-snmp-checker GOFLAGS="-tags=containers" ko build \ - --platform=linux/amd64,linux/arm64 \ - --tags=${SHA_TAG},latest \ - --bare . \ No newline at end of file + # Uncomment after agent works + # cd cmd/cloud + # KO_DOCKER_REPO=${{ env.BASE_REPO }}/serviceradar-cloud CGO_ENABLED=1 GOFLAGS="-tags=containers" ko build ... + # (add other components) \ No newline at end of file From 95f70894ff09e08ed256f8cbe0a16cf1305d46c1 Mon Sep 17 00:00:00 2001 From: Michael Freeman Date: Tue, 25 Feb 2025 10:21:11 -0600 Subject: [PATCH 2/2] missing file --- cmd/cloud/.ko.yaml | 1 + 1 file changed, 1 insertion(+) create mode 100644 cmd/cloud/.ko.yaml diff --git a/cmd/cloud/.ko.yaml b/cmd/cloud/.ko.yaml new file mode 100644 index 0000000..29582ff --- /dev/null +++ b/cmd/cloud/.ko.yaml @@ -0,0 +1 @@ +defaultBaseImage: cgr.dev/chainguard/ko