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

*: Move manifests to a saner location #1304

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:

# This is also done again in run-kola-tests.yaml because these changes here disappear
source ci-automation/ci_automation_common.sh
source sdk_container/.repo/manifests/version.txt
source manifests/version.txt

version="alpha-$FLATCAR_VERSION_ID"
check_version_string "$version"
Expand Down Expand Up @@ -196,7 +196,7 @@ jobs:
source ci-automation/image_changes.sh

channel=alpha
vernum=$(source sdk_container/.repo/manifests/version.txt; echo "${FLATCAR_VERSION}")
vernum=$(source manifests/version.txt; echo "${FLATCAR_VERSION}")
board="${arch}-usr"

package_diff_env=(
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/mantle-releases-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ jobs:
set -euo pipefail
set -x
commit=${{ steps.fetch-latest-mantle.outputs.COMMIT }}
if ! grep -q "ghcr.io/flatcar/mantle:git-${commit}" sdk_container/.repo/manifests/mantle-container; then
echo "ghcr.io/flatcar/mantle:git-${commit}" > sdk_container/.repo/manifests/mantle-container
git add sdk_container/.repo/manifests/mantle-container
if ! grep -q "ghcr.io/flatcar/mantle:git-${commit}" manifests/mantle-container; then
echo "ghcr.io/flatcar/mantle:git-${commit}" > manifests/mantle-container
git add manifests/mantle-container
fi
- name: Create pull request for branch
if: ${{ steps.figure-out-branch.outputs.SKIP == 0 }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-kola-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ jobs:
pushd scripts

source ci-automation/ci_automation_common.sh
source sdk_container/.repo/manifests/version.txt
source manifests/version.txt

version="alpha-$FLATCAR_VERSION_ID"
check_version_string "$version"
Expand Down Expand Up @@ -324,7 +324,7 @@ jobs:
done
done

source sdk_container/.repo/manifests/version.txt
source manifests/version.txt
tap_generate_report "${all_archs}" "${FLATCAR_VERSION}" "md" "true" > test-results.md

cat test-results.md >> "$GITHUB_STEP_SUMMARY"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/setup-flatcar-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ sudo apt-get install -y docker-ce docker-ce-cli containerd.io \
pushd "${WORK_SCRIPTS_DIR}"

source ci-automation/ci_automation_common.sh
source sdk_container/.repo/manifests/version.txt
source manifests/version.txt

# run_sdk_container requires a tag to exist in the repo it resides,
# which may not be the case for forked repos. Add some fake tag in
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/update-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
set -euo pipefail

source ci-automation/ci_automation_common.sh
source sdk_container/.repo/manifests/version.txt
source manifests/version.txt

version="alpha-$FLATCAR_VERSION_ID"
sdk_version="${SOURCE_SDK_VERSION:-$FLATCAR_SDK_VERSION}"
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
echo "setting sdk_version=${target_version} as a github output"
echo "sdk_version=${target_version}" >> "$GITHUB_OUTPUT"

# This also updates sdk_container/.repo/manifests/version.txt with the new SDK version.
# This also updates manifests/version.txt with the new SDK version.
./update_sdk_container_image "${target_version}"

- name: Upload the SDK container and binary packages to bincache
Expand All @@ -144,7 +144,7 @@ jobs:
echo " User ${BUILDCACHE_USER}" >> ~/.ssh/config
echo " IdentityFile ~/.ssh/bincache" >> ~/.ssh/config

source sdk_container/.repo/manifests/version.txt
source manifests/version.txt
vernum="${FLATCAR_SDK_VERSION}"
docker_vernum="$(vernum_to_docker_image_version "${vernum}")"

Expand Down
8 changes: 6 additions & 2 deletions build_toolchains
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ stage4/root_overlay: ${ROOT_OVERLAY}
EOF
catalyst_stage_default
}

create_provenance_overlay() {
local root_overlay="$1"
local f d
while read f; do
d="${f%/*}"
mkdir -p "${root_overlay}${d}/"
Expand All @@ -36,13 +38,15 @@ create_provenance_overlay() {
local scripts_git=/mnt/host/source/src/scripts/.git
# `git rev-parse` fails due to the safe.directory setting in SDK container.
# Open-code the ref lookup
local scripts_hash
read scripts_hash <"${scripts_git}/HEAD"
if [[ "${scripts_hash}" == "ref:"* ]]; then
read scripts_hash<"${scripts_git}/${scripts_hash#ref: }"
echo "${scripts_hash}" >"${root_overlay}${scripts_git}/HEAD"
fi
mkdir -p "${root_overlay}/mnt/host/source/.repo/manifests"
cp "${REPO_MANIFESTS_DIR}/version.txt" "${root_overlay}/mnt/host/source/.repo/manifests"
local mdir="${root_overlay}/mnt/host/source/src/scripts/manifests"
mkdir -p "${mdir}"
cp "${REPO_MANIFESTS_DIR}/version.txt" "${mdir}"
}

catalyst_init "$@"
Expand Down
2 changes: 1 addition & 1 deletion ci-automation/ci_automation_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function update_and_push_version() {
fi

# Add and commit local changes
git add "sdk_container/.repo/manifests/version.txt"
git add "manifests/version.txt"

git commit --allow-empty -m "New version: ${version}"

Expand Down
11 changes: 8 additions & 3 deletions ci-automation/garbage_collect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,13 @@ function _garbage_collect_impl() {
echo "#### Processing version '${version}' ####"
echo

git checkout "${version}" -- sdk_container/.repo/manifests/version.txt
source sdk_container/.repo/manifests/version.txt
vertxt=manifests/version.txt
if ! git checkout "${version}" -- "${vertxt}"; then
echo 'Trying to check out the old location of the version.txt then.'
vertxt=sdk_container/.repo/manifests/version.txt
git checkout "${version}" -- "${vertxt}"
fi
source "${vertxt}"

# Assuming that the SDK build version also has the same OS version
local os_vernum="${FLATCAR_VERSION}"
Expand Down Expand Up @@ -151,7 +156,7 @@ function _garbage_collect_impl() {
echo

local mantle_ref
mantle_ref=$(cat sdk_container/.repo/manifests/mantle-container)
mantle_ref=$(cat manifests/mantle-container)
docker run --pull always --rm --net host \
--env AZURE_AUTH_CREDENTIALS --env AZURE_PROFILE \
--env AWS_ACCESS_KEY_ID --env AWS_SECRET_ACCESS_KEY \
Expand Down
4 changes: 2 additions & 2 deletions ci-automation/image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#
# PREREQUISITES:
#
# 1. SDK version and OS image version are recorded in sdk_container/.repo/manifests/version.txt
# 1. SDK version and OS image version are recorded in manifests/version.txt
# 2. Scripts repo version tag of OS image version to be built is available and checked out.
# 3. Flatcar packages container is available via build cache server
# from "/containers/[VERSION]/flatcar-packages-[ARCH]-[FLATCAR_VERSION].tar.gz"
Expand Down Expand Up @@ -63,7 +63,7 @@ function _image_build_impl() {
source ci-automation/ci_automation_common.sh
source ci-automation/gpg_setup.sh

source sdk_container/.repo/manifests/version.txt
source manifests/version.txt
local vernum="${FLATCAR_VERSION}"
local docker_vernum="$(vernum_to_docker_image_version "${vernum}")"

Expand Down
2 changes: 1 addition & 1 deletion ci-automation/image_changes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function image_changes() (
if [ "${channel}" = "developer" ]; then
channel="alpha"
fi
vernum=$(source sdk_container/.repo/manifests/version.txt; echo "${FLATCAR_VERSION}")
vernum=$(source manifests/version.txt; echo "${FLATCAR_VERSION}")

local -a package_diff_env package_diff_params_b
local -a size_changes_env size_changes_params_b
Expand Down
6 changes: 3 additions & 3 deletions ci-automation/packages-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
# PREREQUISITES:
#
# 1. SDK version is recorded in sdk_container/.repo/manifests/version.txt
# 1. SDK version is recorded in manifests/version.txt
# 2. SDK container is either
# - available via ghcr.io/flatcar/flatcar-sdk-[ARCH]:[VERSION] (official SDK release)
# OR
Expand All @@ -41,7 +41,7 @@
#
# 1. Updated scripts repository
# - version tag
# - sdk_container/.repo/manifests/version.txt denotes new FLATCAR OS version
# - manifests/version.txt denotes new FLATCAR OS version
# 2. "./skip-build" as flag file to signal that the build should stop

function packages_tag() {
Expand All @@ -63,7 +63,7 @@ function _packages_tag_impl() {

check_version_string "${version}"

source sdk_container/.repo/manifests/version.txt
source manifests/version.txt
local sdk_version="${FLATCAR_SDK_VERSION}"

# Create new tag in scripts repo w/ updated versionfile
Expand Down
6 changes: 3 additions & 3 deletions ci-automation/packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#
# PREREQUISITES:
#
# 1. SDK version and OS image version are recorded in sdk_container/.repo/manifests/version.txt
# 1. SDK version and OS image version are recorded in manifests/version.txt
# 2. Scripts repo version tag of OS image version to be built is available and checked out.
# 3. SDK container is either
# - available via ghcr.io/flatcar/flatcar-sdk-[ARCH]:[VERSION] (official SDK release)
Expand Down Expand Up @@ -64,7 +64,7 @@ function _packages_build_impl() {
source ci-automation/ci_automation_common.sh
source ci-automation/gpg_setup.sh

source sdk_container/.repo/manifests/version.txt
source manifests/version.txt
local sdk_version="${FLATCAR_SDK_VERSION}"

# Get SDK from either the registry or import from build cache
Expand All @@ -90,7 +90,7 @@ function _packages_build_impl() {
./build_packages --board="${arch}-usr"

# run_sdk_container updates the version file, use that version from here on
source sdk_container/.repo/manifests/version.txt
source manifests/version.txt
local vernum="${FLATCAR_VERSION}"
local docker_vernum="$(vernum_to_docker_image_version "${vernum}")"
local packages_image="flatcar-packages-${arch}"
Expand Down
4 changes: 2 additions & 2 deletions ci-automation/push_pkgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# PREREQUISITES:
#
# 1. SDK version and OS image version are recorded in sdk_container/.repo/manifests/version.txt
# 1. SDK version and OS image version are recorded in manifests/version.txt
# 2. Scripts repo version tag of OS image version to be built is available and checked out.
# 3. Flatcar packages container is available via build cache server
# from "/containers/[VERSION]/flatcar-packages-[ARCH]-[FLATCAR_VERSION].tar.gz"
Expand Down Expand Up @@ -79,7 +79,7 @@ function _push_packages_impl() {
source ci-automation/ci_automation_common.sh
source ci-automation/gpg_setup.sh

source sdk_container/.repo/manifests/version.txt
source manifests/version.txt
local vernum="${FLATCAR_VERSION}"
local docker_vernum="$(vernum_to_docker_image_version "${vernum}")"

Expand Down
10 changes: 5 additions & 5 deletions ci-automation/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#
# PREREQUISITES:
#
# 1. SDK version and OS image version are recorded in sdk_container/.repo/manifests/version.txt
# 1. SDK version and OS image version are recorded in manifests/version.txt
# 2. Scripts repo version tag of OS image version to be built is available and checked out.
# 3. Mantle container docker image reference is stored in sdk_container/.repo/manifests/mantle-container.
# 3. Mantle container docker image reference is stored in manifests/mantle-container.
# 4. Vendor image to run tests for are available on buildcache
# ( images/[ARCH]/[FLATCAR_VERSION]/ )
# 5. SDK container is either
Expand Down Expand Up @@ -74,7 +74,7 @@ function _inside_mantle() {

source sdk_lib/sdk_container_common.sh
source ci-automation/ci_automation_common.sh
source sdk_container/.repo/manifests/version.txt
source manifests/version.txt
# Needed because we are not the SDK container here
source sdk_container/.env
CHANNEL="$(get_git_channel)"
Expand Down Expand Up @@ -189,7 +189,7 @@ function _release_build_impl() {
source ci-automation/ci_automation_common.sh
source ci-automation/gpg_setup.sh

source sdk_container/.repo/manifests/version.txt
source manifests/version.txt
# Needed because we are not the SDK container here
source sdk_container/.env
local sdk_version="${FLATCAR_SDK_VERSION}"
Expand All @@ -201,7 +201,7 @@ function _release_build_impl() {

local container_name="flatcar-publish-${docker_vernum}"
local mantle_ref
mantle_ref=$(cat sdk_container/.repo/manifests/mantle-container)
mantle_ref=$(cat manifests/mantle-container)
# A job on each worker prunes old mantle images (docker image prune), no need to do it here
echo "docker rm -f '${container_name}'" >> ./ci-cleanup.sh

Expand Down
4 changes: 2 additions & 2 deletions ci-automation/sdk_bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
# 1. SDK tarball (gentoo catalyst output) of the new SDK, pushed to buildcache.
# 2. Updated scripts repository
# - version tag
# - sdk_container/.repo/manifests/version.txt denotes new SDK version
# - manifests/version.txt denotes new SDK version
# 3. "./ci-cleanup.sh" with commands to clean up temporary build resources,
# to be run after this step finishes / when this step is aborted.
# 4. If signer key was passed, signatures of artifacts from point 1, pushed along to buildcache.
Expand Down Expand Up @@ -147,7 +147,7 @@ function _sdk_bootstrap_impl() {
# push SDK tarball to buildcache
# Get Flatcar version number format (separator is '+' instead of '-',
# equal to $(strip_version_prefix "$version")
source sdk_container/.repo/manifests/version.txt
source manifests/version.txt
local dest_tarball="flatcar-sdk-${ARCH}-${FLATCAR_SDK_VERSION}.tar.bz2"

# change the owner of the files and directories in __build__ back
Expand Down
4 changes: 2 additions & 2 deletions ci-automation/sdk_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# PREREQUISITES:
#
# 1. SDK version is recorded in sdk_container/.repo/manifests/version.txt and a matching
# 1. SDK version is recorded in manifests/version.txt and a matching
# SDK tarball is available on BUILDCACHE/sdk/[ARCH]/[VERSION]/flatcar-sdk-[ARCH]-[VERSION].tar.bz2
#
# OPTIONAL INPUT:
Expand Down Expand Up @@ -56,7 +56,7 @@ function _sdk_container_build_impl() {
source ci-automation/ci_automation_common.sh
source ci-automation/gpg_setup.sh

source sdk_container/.repo/manifests/version.txt
source manifests/version.txt
local vernum="${FLATCAR_SDK_VERSION}"
local sdk_tarball="flatcar-sdk-${ARCH}-${vernum}.tar.bz2"

Expand Down
8 changes: 4 additions & 4 deletions ci-automation/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
#
# PREREQUISITES:
#
# 1. SDK version and OS image version are recorded in sdk_container/.repo/manifests/version.txt
# 1. SDK version and OS image version are recorded in manifests/version.txt
# 2. Scripts repo version tag of OS image version to be built is available and checked out.
# 3. Mantle container docker image reference is stored in sdk_container/.repo/manifests/mantle-container.
# 3. Mantle container docker image reference is stored in manifests/mantle-container.
# 4. Vendor image to run tests for are available on buildcache
# ( images/[ARCH]/[FLATCAR_VERSION]/ )
#
Expand Down Expand Up @@ -112,7 +112,7 @@ function _test_run_impl() {
source ci-automation/ci_automation_common.sh
source sdk_lib/sdk_container_common.sh

source sdk_container/.repo/manifests/version.txt
source manifests/version.txt
local vernum="${FLATCAR_VERSION}"
local docker_vernum
docker_vernum="$(vernum_to_docker_image_version "${vernum}")"
Expand All @@ -130,7 +130,7 @@ function _test_run_impl() {

local container_name="flatcar-tests-${arch}-${docker_vernum}-${image}"
local mantle_ref
mantle_ref=$(cat sdk_container/.repo/manifests/mantle-container)
mantle_ref=$(cat manifests/mantle-container)

local tap_merged_summary="results-${image}"
local tap_merged_detailed="results-${image}-detailed"
Expand Down
2 changes: 1 addition & 1 deletion ci-automation/util/fetch_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function fetch_image() {
local script_root="$(dirname "${BASH_SOURCE[0]}")/../.."
source "${script_root}/ci-automation/ci_automation_common.sh"

local vernum="$(source "${script_root}/sdk_container/.repo/manifests/version.txt";
local vernum="$(source "${script_root}/manifests/version.txt";
echo "${FLATCAR_VERSION}")"
local docker_vernum="$(vernum_to_docker_image_version "${vernum}")"

Expand Down
4 changes: 2 additions & 2 deletions ci-automation/vms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#
# PREREQUISITES:
#
# 1. SDK version and OS image version are recorded in sdk_container/.repo/manifests/version.txt
# 1. SDK version and OS image version are recorded in manifests/version.txt
# 2. Scripts repo version tag of OS image version to be built is available and checked out.
# 3. Flatcar packages container is available via build cache server
# from "/containers/[VERSION]/flatcar-images-[ARCH]-[FLATCAR_VERSION].tar.gz"
Expand Down Expand Up @@ -65,7 +65,7 @@ function _vm_build_impl() {
source ci-automation/ci_automation_common.sh
source ci-automation/gpg_setup.sh

source sdk_container/.repo/manifests/version.txt
source manifests/version.txt
local vernum="${FLATCAR_VERSION}"
local docker_vernum="$(vernum_to_docker_image_version "${vernum}")"

Expand Down
2 changes: 1 addition & 1 deletion common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ SRC_INTERNAL="${GCLIENT_ROOT}/src-internal"
SCRIPTS_DIR="${SRC_ROOT}/scripts"
BUILD_LIBRARY_DIR="${SCRIPTS_DIR}/build_library"
REPO_CACHE_DIR="${REPO_ROOT}/.cache"
REPO_MANIFESTS_DIR="${REPO_ROOT}/.repo/manifests"
REPO_MANIFESTS_DIR="${SCRIPTS_DIR}/manifests"

# Source FLATCAR_VERSION_ID from manifest.
if [[ -f "${REPO_MANIFESTS_DIR}/version.txt" ]]; then
Expand Down
1 change: 1 addition & 0 deletions manifests/mantle-container
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ghcr.io/flatcar/mantle:pr-470
File renamed without changes.
File renamed without changes.
Loading
Loading