flatcar / Flatcar

Flatcar project repository for issue tracking, project documentation, etc.
https://www.flatcar.org/
Apache License 2.0
657 stars 28 forks source link

3139.0.0 - ./run_sdk_container -t fails #1335

Open JanneKiiskila opened 5 months ago

JanneKiiskila commented 5 months ago

Description

Can't build older version of flatcar (3139.0.0).

Impact

Can't start the docker/SDK following the instructions.

Environment and steps to reproduce

  1. Set-up:

Ubuntu 22.04 host machine.

flatcar/scripts$ uname -a
Linux jannek-P720 6.5.0-15-generic #15~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Jan 12 18:54:30 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
flatcar/scripts$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:    22.04
Codename:   jammy

Take the normal steps as detailed in the documentation - https://www.flatcar.org/docs/latest/reference/developer-guides/sdk-modifying-flatcar/.

git clone https://github.com/flatcar/scripts.git
cd scripts
git checkout stable-3139.2.3

1st it fails to fetch images, as the GitHub domain for flatcar has changed from flatcar-linux to flatcar. I wonder why GitHub redirection is not working?

Anyways, once you fix that by doing a global search & replace for flatcar-linux to flatcar you can continue.

./run_sdk_container -t
  1. Task: [ describe the task performing when encountering the bug ]

Run the SDK.

  1. Action(s): [ sequence of actions that triggered the bug, see example below ]

See above. Just run the sdk container.

  1. Error: [describe the error that was triggered]
flatcar/scripts$ ./run_sdk_container -t

###### Writing versionfile 'sdk_container/.repo/manifests/version.txt' to SDK '3139.0.0', OS '3139.2.3+1-g412586ef00'. ######

###### Creating a new container 'flatcar-sdk-all-3139.0.0_os-stable-3139.2.3-1-g412586ef00' ######
ed0d82ee0e9adab88f168e795b5bbea41e696b0505202db0f9ba3f279c17386b

###### Starting stopped container 'flatcar-sdk-all-3139.0.0_os-stable-3139.2.3-1-g412586ef00' ######
flatcar-sdk-all-3139.0.0_os-stable-3139.2.3-1-g412586ef00
usermod: no changes

Updating board support in '/build/amd64-usr' to use package cache for version '3139.2.3'
---
INFO    setup_board: Configuring portage in /build/amd64-usr
!!! Warning: Failed to determine ${ARCH}. Is your make.profile symlink valid?
sed: can't read /mnt/host/source/src/third_party/coreos-overlay/profiles/profiles.desc: No such file or directory
!!! Error: No profile directory for target "coreos/amd64/generic"
exiting
ERROR   setup_board: script called: setup_board '--board=amd64-usr' '--regen_configs_only'
ERROR   setup_board: Backtrace:  (most recent call is last)
ERROR   setup_board:   file setup_board, line 237, called: die_err_trap 'sudo ROOT="${BOARD_ROOT}" eselect profile set --force "${PORTAGE_PROFILE}"' '250'
ERROR   setup_board: 
ERROR   setup_board: Command failed:
ERROR   setup_board:   Command 'sudo ROOT="${BOARD_ROOT}" eselect profile set --force "${PORTAGE_PROFILE}"' exited with nonzero code: 250

Updating board support in '/build/arm64-usr' to use package cache for version '3139.2.3'
---
INFO    setup_board: Configuring portage in /build/arm64-usr
!!! Warning: Failed to determine ${ARCH}. Is your make.profile symlink valid?
sed: can't read /mnt/host/source/src/third_party/coreos-overlay/profiles/profiles.desc: No such file or directory
!!! Error: No profile directory for target "coreos/arm64/generic"
exiting
ERROR   setup_board: script called: setup_board '--board=arm64-usr' '--regen_configs_only'
ERROR   setup_board: Backtrace:  (most recent call is last)
ERROR   setup_board:   file setup_board, line 237, called: die_err_trap 'sudo ROOT="${BOARD_ROOT}" eselect profile set --force "${PORTAGE_PROFILE}"' '250'
ERROR   setup_board: 
ERROR   setup_board: Command failed:
ERROR   setup_board:   Command 'sudo ROOT="${BOARD_ROOT}" eselect profile set --force "${PORTAGE_PROFILE}"' exited with nonzero code: 250

Expected behavior

It should work as assumed.

Additional information

Seems the work area from git's point of view also gets messed up, once you run that command.

flatcar/scripts$ git status
fatal: invalid gitfile format: sdk_container/src/third_party/coreos-overlay/.git
JanneKiiskila commented 5 months ago

Latest one does work. The challenge just is that I would need that exact version.

flatcar/scripts$ ./run_sdk_container -t -a amd64

###### Writing versionfile 'sdk_container/.repo/manifests/version.txt' to SDK '3760.0.0', OS '3760.2.0'. ######

###### Creating a new container 'flatcar-sdk-amd64-3760.0.0_os-stable-3760.2.0' ######
3760.0.0: Pulling from flatcar/flatcar-sdk-amd64
892900005b91: Pull complete 
2f8ff45a7008: Pull complete 
e83e8197e734: Pull complete 
9ce0b43a2c04: Pull complete 
Digest: sha256:dacbb13b1a8ee5045035baf483172848d221f44812d93ba404e521e85cfd32b3
Status: Downloaded newer image for ghcr.io/flatcar/flatcar-sdk-amd64:3760.0.0
ghcr.io/flatcar/flatcar-sdk-amd64:3760.0.0
89314a3d4e92f8429c4c9cbfa87ff462e8a5243f0e0ecd4e433bb74ca40fbdc1

###### Starting stopped container 'flatcar-sdk-amd64-3760.0.0_os-stable-3760.2.0' ######
flatcar-sdk-amd64-3760.0.0_os-stable-3760.2.0
usermod: no changes

Updating board support in '/build/amd64-usr' to use package cache for version '3760.2.0'
---
INFO    setup_board: Configuring portage in /build/amd64-usr
INFO    setup_board: Generating wrapper scripts
INFO    setup_board: Performing package updates...
Emaint: fix movebin        100% [============================================>]
Emaint: fix moveinst       100% [============================================>]
Emaint: fix world          100% [============================================>]
INFO    setup_board: Elapsed time (setup_board): 0m4s
JanneKiiskila commented 5 months ago

I think my changes were too radical, seems you have still a mix of flatcar-linux and flatcar in use. Therefore a global search & replace is not going to work.

jepio commented 5 months ago

hi @JanneKiiskila,

That release still used submodules. So try the following:

git clone https://github.com/flatcar/scripts --branch stable-3139.2.3 scripts-3139
cd scripts-3139
git submodule init
git submodule update
patch -p1 <<EOF
diff --git a/ci-automation/ci-config.env b/ci-automation/ci-config.env
index 40f6a6a959..2c1ddbd608 100644
--- a/ci-automation/ci-config.env
+++ b/ci-automation/ci-config.env
@@ -9,12 +9,12 @@ BUILDCACHE_PATH_PREFIX="/srv/bincache"
 BUILDCACHE_USER="bincache"

 RELEASES_SERVER="mirror.release.flatcar-linux.net"
-CONTAINER_REGISTRY="ghcr.io/flatcar-linux"
+CONTAINER_REGISTRY="ghcr.io/flatcar"

 GC_BUCKET="flatcar-linux"

 # No PIGZ on Flatcar
-PIGZ="docker run --rm -i ghcr.io/flatcar-linux/pigz --fast"
+PIGZ="docker run --rm -i ghcr.io/flatcar/pigz --fast"

 CI_GIT_AUTHOR="flatcar-ci"
 CI_GIT_EMAIL="infra+ci@flatcar-linux.org"
diff --git a/sdk_lib/sdk_container_common.sh b/sdk_lib/sdk_container_common.sh
index 11325ff6dc..177010e125 100644
--- a/sdk_lib/sdk_container_common.sh
+++ b/sdk_lib/sdk_container_common.sh
@@ -8,7 +8,7 @@
 # globals
 #
 sdk_container_common_versionfile="sdk_container/.repo/manifests/version.txt"
-sdk_container_common_registry="ghcr.io/flatcar-linux"
+sdk_container_common_registry="ghcr.io/flatcar"
 sdk_container_common_env_file="sdk_container/.sdkenv"

 # Check for podman and docker; use docker if present, podman alternatively.
EOF
./run_sdk_container -t

The repository itself has redirects from flatcar-linux -> flatcar after the rename, but that doesn't extend to containers images on ghcr.io.

JanneKiiskila commented 5 months ago

@jepio - thank you, I will try that - appreciate the support! Seems a few more ghcr.io changes required.

JanneKiiskila commented 5 months ago

Is it a known issue that the bincache does not seem to have anything for 3193? A lot of the other releases are found there, for multiple 3033 versions but then it jumps to 3374.

https://bincache.flatcar-linux.net/boards/amd64-usr/

image

jepio commented 5 months ago

3193 was not a Flatcar release, 3139 is. Yes, this is expected. Bincache has limited storage capacity and so we only keep current releases, and some number of historic releases.

Are you sure you want to rebuild 3139? It's very old and very vulnerable.