Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes for release pipeline (aarch64) #9481

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

sajjaphani
Copy link
Contributor

@sajjaphani sajjaphani commented Nov 21, 2024

Currently, the release pipeline is failing because it is falling back to the LTS-2024 channel, where none of the hab* packages exist. To unblock the release pipeline, the fallback channel has been updated to stable.

Note: The hab, hab-studio, hab-backline, and hab-plan-build packages with version 1.6.1178 1.6.1218 have been promoted to the stable channel.

Signed-off-by: Phani Sajja <[email protected]>
Copy link

netlify bot commented Nov 21, 2024

👷 Deploy Preview for chef-habitat processing.

Name Link
🔨 Latest commit 8685087
🔍 Latest deploy log https://app.netlify.com/sites/chef-habitat/deploys/675c198d72eba2000869a2db

@mwrock
Copy link
Contributor

mwrock commented Nov 22, 2024

You actually want the release channel to fall back t oLTS-2024. The "primary" HAB_BLDR_CHANNEL should be a dynamically created channel based on the BUILDKITE_BUILD_ID. As components are built in the pipeline, the they are uploaded to this channel. So core/hab is built and uploaded to that channel and then core/hab-plan-build should get hab from that channel.

I'm looking at https://buildkite.com/chef/habitat-sh-habitat-main-release-habitat/builds/2002 where the release pipeline is failing. For some reason hab-plan-build is not honoring HAB_BLDR_CHANNEL, but I have not looked deeply into this. Anyways, I think that is the problem you want to investigate. If you fall back to stable, then all of the deps will come from stable instead of LTS-2024.

@sajjaphani
Copy link
Contributor Author

For aarch64, we have core packages in the LTS-2024 channel, and the hab* packages built against them are placed in the stable channel.
We introduced the HAB_REFRESH_CHANNEL to pull core dependencies, and the aarch64 packages in the stable channel are built with these changes.

local channel="$HAB_BLDR_CHANNEL"
if [[ -z "${NO_INSTALL_DEPS:-}" ]]; then
origin="$(echo "$dep" | cut -d "/" -f 1)"
if [[ $origin == "core" || $origin == "chef" || $origin == "chef-platform" ]]; then
channel="$HAB_REFRESH_CHANNEL"
if [[ $HAB_PREFER_LOCAL_CHEF_DEPS == "false" ]]; then
IGNORE_LOCAL="--ignore-local"
fi

It appears that with the introduction of HAB_REFRESH_CHANNEL, the HAB_BLDR_CHANNEL is no longer honored for core packages.

For aarch64, the HAB_REFRESH_CHANNEL is set to LTS-2024 in both the verify and release pipelines to pull dependencies, while the HAB_FALLBACK_CHANNEL is configured to pull the hab, hab-studio, and similar packages from the stable channel. No other packages, except for hab, hab-studio, and related ones, are present in the stable channel.

@@ -853,7 +853,7 @@ steps:
HAB_LICENSE: "accept-no-persist"
HAB_BLDR_CHANNEL: "LTS-2024"
HAB_REFRESH_CHANNEL: "LTS-2024"
HAB_FALLBACK_CHANNEL: "lts24-aarch64-linux"
HAB_FALLBACK_CHANNEL: "stable"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove all of these HAB_FALLBACK_CHANNEL exports in the file. stable is the default. However, if you did want to override stable then you would need to use HAB_STUDIO_SECRET_HAB_FALLBACK_CHANNEL. HAB_FALLBACK_CHANNEL will not get passed into the studio.

@@ -19,12 +19,9 @@ HAB_CACHE_KEY_PATH="$JOB_TEMP_ROOT/keys"

export HAB_STUDIO_SECRET_HAB_FALLBACK_CHANNEL
HAB_STUDIO_SECRET_HAB_FALLBACK_CHANNEL="$HAB_FALLBACK_CHANNEL"
export HAB_PREFER_LOCAL_CHEF_DEPS="true"
export HAB_PREFER_LOCAL_CHEF_DEPS="false"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you want to remove, this is the default

@mwrock
Copy link
Contributor

mwrock commented Dec 5, 2024

I ran a test release build from this branch and the built components used in the front of the pipeline are not getting consumed by their dependent components. This can be seen in https://buildkite.com/chef/habitat-sh-habitat-main-release-habitat/builds/2009#019397ab-5b97-486b-8433-7dc6b7bfb6c1/429-693. Here the core/hab built at the beginning of the pipeline is core/hab/1.6.1218/20241205163418 and was promoted to habitat-release-019397aa-b2e3-45a5-8ecc-893aa8c7c0ba. However, the hab-plan-build component is pulling core/hab/1.6.1218/20241127073909 from stable.

I think what you need to do to fix this is set HAB_STUDIO_SECRET_HAB_REFRESH_CHANNEL to the release channel in build_component.sh. For the non-hab components, it should pull from the fallback of LTS-2024.

@sajjaphani
Copy link
Contributor Author

If we set HAB_STUDIO_SECRET_HAB_REFRESH_CHANNEL to the release channel with a fallback to LTS-2024, it will only fetch the latest hab binary from the release channel. This raises the question of where hab-studio is being sourced from, as it is essential for building any component.

@mwrock
Copy link
Contributor

mwrock commented Dec 6, 2024

You want the core/hab that builds with the down stream components to be pulled from the release channel. Otherwise, plan-build and the exporters won't include the correct core/hab. The core/hab and studio used to actually do the build will also come from the release channel if they have both been build, but I'm pretty sure that in the earlier stages of the pipeline, it just uses the latest stable hab.

At any rate, in the end, we have to make sure that the release pipeline produces artifacts that all reflect the components that were built off of main. Currently it doesn't look like that is happening here.

@sajjaphani
Copy link
Contributor Author

Updated to point the hab refresh channel to the release channel and set the fallback to LTS-2024 for aarch64.
https://buildkite.com/chef/habitat-sh-habitat-main-release-habitat/builds/2010#0193ab42-8820-4621-baa7-5dd69c954712

i=1
while [ "$i" -le "$MAX_RETRIES" ]
do
sleep $((RETRY_DELAY * i)) # Delay increases with each retry
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm seeing this error in the verify pipeline (https://buildkite.com/chef/habitat-sh-habitat-main-verify/builds/13587#0193abd2-ff85-4a2c-aa7b-eade362a53ca/194-772): /hab/pkgs/core/hab-studio/1.6.1218/20241127103841/bin/hab-studio: line 1075: sleep: No such file or directory. I know sleep lives in coreutils and that probably is not binlinked in the studio.

Signed-off-by: Phani Sajja <[email protected]>
@@ -101,6 +101,9 @@ finish_setup() {
_hab pkg binlink core/bash bash
_hab pkg binlink core/bash sh

# binlink sleep command
_hab pkg binlink "$coreutils_path/bin/sleep" sleep
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be _hab pkg binlink core/coreutils sleep

Signed-off-by: Phani Sajja <[email protected]>
@mwrock
Copy link
Contributor

mwrock commented Dec 10, 2024

@sajjaphani
Copy link
Contributor Author

@sajjaphani still seeing issues with sleep in https://buildkite.com/chef/habitat-sh-habitat-main-verify/builds/13599#0193b0e4-1d0a-417c-aff3-f822ec666930/194-787

This is happening because the older studio does not have sleep symlinked. I’ve rebuilt and uploaded the package, and it is now passing the pipeline.

@mwrock
Copy link
Contributor

mwrock commented Dec 11, 2024

In the release pipeline, I see it built the studio fine and then when it builds the launcher, it uses that studio and I see it binlinking sleep (https://buildkite.com/chef/habitat-sh-habitat-main-release-habitat/builds/2015#0193b66e-cab1-467f-87b2-18dfadde2b04/297-417) but then it fails at the end with the same old sleep: No such file or directory error (https://buildkite.com/chef/habitat-sh-habitat-main-release-habitat/builds/2015#0193b66e-cab1-467f-87b2-18dfadde2b04/297-1640).

Signed-off-by: Phani Sajja <[email protected]>
Signed-off-by: Phani Sajja <[email protected]>
Signed-off-by: Phani Sajja <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants