Skip to content

Commit

Permalink
Avoid container build by adding /.mariner-toolkit-ignore-dockerenv (#…
Browse files Browse the repository at this point in the history
…7409)

Our Azure Linux builds started failing in the past week or so because Azure Linux recently made a change to how they detect container builds (see microsoft/azurelinux#11135), so the trick we employed to force a regular build (even though we're building in a container) stopped working. This change removes the trick and takes the recommended approach of adding `/.mariner-toolkit-ignore-dockerenv` to the container.

Other changes were also needed to resolve problems that came up while testing this PR:
- Snap builds began failing, seemingly due to a bad version combination of snapcraft and lxd. I updated the build task to do `snap refresh` before building.
- Our CI build for Azure Linux on arm64 uses the build scripts from the iot-identity-service repo, so I updated this repo's references to the iot-identity-service repo to fix the container build detection problem there.
- A recent update to a dependency of cross requires a newer rustc version and was causing the edgelet CI runs to fail in this PR because our rustc version is fixed at 1.73, I added the '--locked' flag to the cargo command that installs cross in the edgelet CI build.

To test, I confirmed that the CI Build passes with these changes.

## Azure IoT Edge PR checklist:
  • Loading branch information
damonbarry authored Dec 20, 2024
1 parent 28c44c7 commit 569235e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 31 deletions.
4 changes: 2 additions & 2 deletions builds/checkin/edgelet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
displayName: Set Version
- bash: scripts/linux/generic-rust/install.sh --project-root "edgelet"
displayName: Install Rust
- script: "cargo install cross --version ^0.2"
- script: "cargo install cross --version ^0.2 --locked"
displayName: "Install cross"
- script: "cross build --target armv7-unknown-linux-gnueabihf"
displayName: armv7-unknown-linux-gnueabihf build
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
displayName: Set Version
- bash: scripts/linux/generic-rust/install.sh --project-root "edgelet"
displayName: Install Rust
- script: "cargo install cross --version ^0.2"
- script: "cargo install cross --version ^0.2 --locked"
displayName: "Install cross"
- script: "cross build --target aarch64-unknown-linux-gnu"
displayName: aarch64-unknown-linux-gnu build
Expand Down
3 changes: 3 additions & 0 deletions builds/misc/templates/build-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ stages:
- ImageOverride -equals $(image)
steps:
- script: |
#!/bin/bash
set -xeuo pipefail
sudo snap refresh
sudo snap install snapcraft --classic
lxd init --minimal
SNAPCRAFT_BUILD_INFO=1 snapcraft --use-lxd
Expand Down
52 changes: 26 additions & 26 deletions edgelet/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions edgelet/build/linux/package-mariner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ apt-get install -y \

rm -f /usr/bin/go
ln -vs /usr/lib/go-1.21/bin/go /usr/bin/go
if [ -f /.dockerenv ]; then
mv /.dockerenv /.dockerenv.old
fi
touch /.mariner-toolkit-ignore-dockerenv

# Download Mariner repo and build toolkit
mkdir -p ${MARINER_BUILD_ROOT}
Expand Down

0 comments on commit 569235e

Please sign in to comment.