Skip to content

Commit

Permalink
ci: don't redundantly install manifests/build binaries
Browse files Browse the repository at this point in the history
`make install` is being redundantly run three times for each E2E test:
1. In the workflow: https://github.com/argoproj/argo-workflows/blob/6699ab396f830210f6dcac4f00a9328a629c142f/.github/workflows/ci-build.yaml#L349-L350
2. As a prerequisite of `make start`:
   https://github.com/argoproj/argo-workflows/blob/6699ab396f830210f6dcac4f00a9328a629c142f/Makefile#L547o
3. As a dependency by Kit: https://github.com/argoproj/argo-workflows/blob/6699ab396f830210f6dcac4f00a9328a629c142f/tasks.yaml#L39

Similarly, the changes in
#14012 to centralize
binary building aren't effective because the binaries are being rebuilt.

This eliminates the redundancy by removing the unnecessary prerequisites
from the `Makefile` and the redundant `make install` step in
`ci-build.yaml`. Also, I added `make --touch dist/*` to mark everything
as up-to-date so the binaries aren't rebuilts (docs:
https://www.gnu.org/software/make/manual/html_node/Instead-of-Execution.html)

Signed-off-by: Mason Malone <[email protected]>
  • Loading branch information
MasonM committed Dec 23, 2024
1 parent 6699ab3 commit c962c0f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,6 @@ jobs:
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /usr/local/.ghcup /opt/hostedtoolcache/CodeQL
printf "==> Available space after cleanup\n"
df -h
- name: Install socat (needed by Kubernetes)
run: sudo apt-get -y install socat
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
Expand All @@ -300,6 +298,8 @@ jobs:
with:
python-version: '3.x'
cache: pip
- name: Install socat (needed by Kubernetes) and kit
run: sudo apt-get -y install socat && make kit
- name: Install and start K3S
run: |
if ! echo "${{ matrix.install_k3s_version }}" | egrep '^v[0-9]+\.[0-9]+\.[0-9]+\+k3s1$'; then
Expand Down Expand Up @@ -339,15 +339,15 @@ jobs:
with:
name: cli
path: dist/
- name: Prepare binaries
run: chmod +x dist/* && make --touch dist/*
- name: Set-up /etc/hosts
run: |
echo '127.0.0.1 dex' | sudo tee -a /etc/hosts
echo '127.0.0.1 minio' | sudo tee -a /etc/hosts
echo '127.0.0.1 postgres' | sudo tee -a /etc/hosts
echo '127.0.0.1 mysql' | sudo tee -a /etc/hosts
echo '127.0.0.1 azurite' | sudo tee -a /etc/hosts
- name: Install manifests
run: make install PROFILE=${{matrix.profile}} STATIC_FILES=false
- name: Start controller/API
run: |
make start PROFILE=${{matrix.profile}} \
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: "19"
# This is mainly here so the dependencies get saved to the cache by "actions/setup-go"
- name: Download go dependencies
run: go mod download
# Use the same make target both locally and on CI to make it easier to debug failures.
- name: Build & Lint docs
run: make docs
Expand Down
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -541,11 +541,7 @@ endif

.PHONY: start
ifeq ($(RUN_MODE),local)
ifeq ($(API),true)
start: install controller kit cli
else
start: install controller kit
endif
start: kit
else
start: install kit
endif
Expand Down

0 comments on commit c962c0f

Please sign in to comment.