Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .azldev-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ab4a1581cd1d793ff800240f3c14062849675057
3 changes: 2 additions & 1 deletion .github/instructions/pr-check-workflows.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ If the check builds, renders, or runs PR code, do the whole thing inside the bui

The shared runner image is [`.github/workflows/containers/azldev-runner.Dockerfile`](../workflows/containers/azldev-runner.Dockerfile). It's a minimal Azure Linux base with `mock`, `git`, `python3`, `sudo`, and `azldev` itself (installed to `/usr/local/bin` during image build) — enough to run any `azldev` subcommand. Reuse it rather than building a per-check image; add extras via a derived `FROM localhost/azldev-runner` stage if a check genuinely needs more.

`azldev` is baked in via `go install …/azldev@main` during image build. The pin lives in the Dockerfile so it can be reviewed and bumped deliberately. Image build context is `.github/workflows/containers/` only — keep it that way so the build can never see PR-controlled files.
`azldev` is baked in via `go install` during image build. The version is pinned in `.azldev-version` at the repo root and passed to the Dockerfile as `--build-arg AZLDEV_VERSION=…`. All CI workflows (GH Actions, ADO, Dockerfile) read from the same file. Image build context is `.github/workflows/containers/` only — keep it that way so the build can never see PR-controlled files.
Comment thread
dmcilvaney marked this conversation as resolved.

Build it with the caller's UID so bind-mounted writes don't end up root-owned:

Expand All @@ -40,6 +40,7 @@ Build it with the caller's UID so bind-mounted writes don't end up root-owned:
run: |
docker build \
--build-arg UID=$(id -u) \
--build-arg AZLDEV_VERSION="$(cat .azldev-version)" \
-t localhost/azldev-runner \
-f .github/workflows/containers/azldev-runner.Dockerfile \
.github/workflows/containers/
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ado/sources-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
# Required variables:
# - ApiAudience : Entra ID audience URI for the Control Tower app
# - ApiBaseDirectUrl : Direct base URL of the Control Tower APIM endpoint (bypasses Azure Front Door)
# - AzldevCommit : Commit hash for azldev (go install ...@<commit>)

# Trigger controlled by ADO branch policy — not YAML triggers.
trigger: none
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/ado/templates/sources-upload-stages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ stages:
echo "##[endgroup]"
echo "##[group]Azldev"
echo "Installing azldev@${AZLDEV_COMMIT}..."
go install "github.com/microsoft/azure-linux-dev-tools/cmd/azldev@${AZLDEV_COMMIT}"
AZLDEV_VERSION=$(cat .azldev-version)
echo "Installing azldev@${AZLDEV_VERSION}..."
go install "github.com/microsoft/azure-linux-dev-tools/cmd/azldev@${AZLDEV_VERSION}"
go_bin_path="$(go env GOPATH)/bin"
echo "##vso[task.prependpath]$go_bin_path"
Expand All @@ -114,8 +115,6 @@ stages:
pip install -r .github/workflows/scripts/control-tower/requirements.txt
echo "##[endgroup]"
displayName: "Install dependencies"
env:
AZLDEV_COMMIT: $(AzldevCommit)
# Verify lock files are current. --check-only validates without
# writing, exits nonzero if any lock would change.
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/check-rendered-specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ jobs:
run: |
docker build \
--build-arg UID=$(id -u) \
--build-arg AZLDEV_VERSION="$(cat .azldev-version)" \
-t localhost/azldev-runner \
-f .github/workflows/containers/azldev-runner.Dockerfile \
.github/workflows/containers/
Expand Down Expand Up @@ -238,6 +239,7 @@ jobs:
run: |
docker build \
--build-arg UID=$(id -u) \
--build-arg AZLDEV_VERSION="$(cat .azldev-version)" \
-t localhost/azldev-runner \
-f .github/workflows/containers/azldev-runner.Dockerfile \
.github/workflows/containers/
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/containers/azldev-runner.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ RUN tdnf -y install \
symcrypt-openssl \
&& tdnf clean all

# TODO: pin to a tagged release once azure-linux-dev-tools cuts one.
# `@main` is a moving target — fine while azldev is pre-1.0 and we want
# CI to track upstream, but we should swap to `@vX.Y.Z` (and bump it
# deliberately) once the tool stabilizes. ADO #18834
RUN GOBIN=/usr/local/bin go install \
github.com/microsoft/azure-linux-dev-tools/cmd/azldev@main \
# The version is passed in as a build arg from .azldev-version in the repo
# root. Callers (check-rendered-specs.yml, etc.) read the file and pass it
# via --build-arg so the Dockerfile never needs repo-root build context.
# No default — omitting --build-arg will fail the build loudly.
ARG AZLDEV_VERSION
RUN test -n "${AZLDEV_VERSION}" || { echo "ERROR: AZLDEV_VERSION build-arg is required (read from .azldev-version)" >&2; exit 1; } \
&& GOBIN=/usr/local/bin go install \
"github.com/microsoft/azure-linux-dev-tools/cmd/azldev@${AZLDEV_VERSION}" \
&& rm -rf /root/go /root/.cache

ARG UID=1000
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
cache: false

- name: Install azldev
run: go install github.com/microsoft/azure-linux-dev-tools/cmd/azldev@main
run: |
go install "github.com/microsoft/azure-linux-dev-tools/cmd/azldev@$(cat .azldev-version)"

- name: "Validate config (strict)"
run: azldev config dump > /dev/null

2 changes: 1 addition & 1 deletion DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
The [`azldev`](https://github.com/microsoft/azure-linux-dev-tools) CLI tool drives all component, image, and build workflows. Install it from source (requires Go):

```bash
go install github.com/microsoft/azure-linux-dev-tools/cmd/azldev@main
go install "github.com/microsoft/azure-linux-dev-tools/cmd/azldev@$(cat .azldev-version)"
```

> **Note:** azldev is still in active development, using the latest commit from the `main` branch is recommended for the most up-to-date features and fixes.
Expand Down
Loading