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

various changes #2138

Merged
merged 8 commits into from
Aug 11, 2023
Merged

various changes #2138

merged 8 commits into from
Aug 11, 2023

Conversation

guits
Copy link
Collaborator

@guits guits commented Aug 2, 2023

see each commit for details

@guits guits force-pushed the fix-arm64 branch 2 times, most recently from 951b37e to b034c17 Compare August 3, 2023 15:16
daemon images is going to be dropped soon.
Let's build daemon-base and demo only

Signed-off-by: Guillaume Abrioux <[email protected]>
This introduces a new variable `TAG_REPO` so one can
set which registry will be used in the created tag.

Signed-off-by: Guillaume Abrioux <[email protected]>
@guits guits changed the title tests: do not build daemon image for arm64 various changes Aug 7, 2023
@guits guits force-pushed the fix-arm64 branch 2 times, most recently from 295f66d to 757930f Compare August 7, 2023 14:56
@guits
Copy link
Collaborator Author

guits commented Aug 7, 2023

jenkins flake8

@guits guits force-pushed the fix-arm64 branch 11 times, most recently from 16c25a9 to e75e72d Compare August 8, 2023 09:48
@guits
Copy link
Collaborator Author

guits commented Aug 10, 2023

jenkins test flake8

@guits
Copy link
Collaborator Author

guits commented Aug 10, 2023

jenkins flake8

I think the following error is not very helpful:

```
[vagrant@ci-1 ceph-container]$ DEBUG=1 make BASEOS_REGISTRY=quay.io/centos BASEOS_TAG=stream9 RELEASE="$(git rev-parse --short HEAD)" FLAVORS="main,centos,9" IMAGES_TO_BUILD="daemon-base" stage

  CEPH_VERSION      : main
  CEPH_REF          : main
  CEPH_POINT_RELEASE:
  CEPH_DEVEL        : false
  OSD_FLAVOR        : default
  DISTRO            : centos
  DISTRO_VERSION    : 9
  HOST_ARCH         : x86_64
  BASEOS_REGISTRY   : quay.io/centos
  BASEOS_REPO       : centos
  BASEOS_TAG        : stream9
  IMAGES_TO_BUILD   : daemon-base
  STAGING_DIR       : staging/main-centos-9-x86_64
  RELEASE           : 2fb63752
  DAEMON_BASE_IMAGE : quay.io/ceph/daemon-base:2fb63752-main-centos-stream9-x86_64
  DAEMON_IMAGE      : quay.io/ceph/daemon:2fb63752-main-centos-stream9-x86_64
  DEMO_IMAGE        : quay.io/ceph/demo:2fb63752-main-centos-stream9-x86_64

Computed:
  BASE_IMAGE        : quay.io/centos/centos:stream9

Traceback (most recent call last):
  File "maint-lib/stage.py", line 117, in <module>
    main(CORE_FILES_DIR, CEPH_RELEASES_DIR)
  File "maint-lib/stage.py", line 108, in main
    do_variable_replace(replace_root_dir=os.path.join(STAGING_DIR, image))
  File "/home/vagrant/ceph-container/maint-lib/stagelib/replace.py", line 131, in do_variable_replace
    total_replacements, rendered_text = _do_replace_on_file(file_path, replace_root_dir)
  File "/home/vagrant/ceph-container/maint-lib/stagelib/replace.py", line 93, in _do_replace_on_file
    rendered_text, file_path, variable_file_dir=replace_root_dir)
  File "/home/vagrant/ceph-container/maint-lib/stagelib/replace.py", line 61, in _file_replace
    template_text, file_path)
  File "/home/vagrant/ceph-container/maint-lib/stagelib/replace.py", line 35, in _replace_file_in_text
    with open(variable_file_path) as variable_file:
FileNotFoundError: [Errno 2] No such file or directory: 'staging/main-centos-9-x86_64/daemon-base/__ENABLE_REPOS__'
make: *** [Makefile:63: stage.x86_64,main,centos,9] Error 1
```

Having a clear message pointing out what file is missing is slightly more meaningful:

```
[vagrant@ci-1 ceph-container]$ DEBUG=1 make BASEOS_REGISTRY=quay.io/centos BASEOS_TAG=stream9 RELEASE="$(git rev-parse --short HEAD)" FLAVORS="main,centos,9" IMAGES_TO_BUILD="daemon-base" stage

  CEPH_VERSION      : main
  CEPH_REF          : main
  CEPH_POINT_RELEASE:
  CEPH_DEVEL        : false
  OSD_FLAVOR        : default
  DISTRO            : centos
  DISTRO_VERSION    : 9
  HOST_ARCH         : x86_64
  BASEOS_REGISTRY   : quay.io/centos
  BASEOS_REPO       : centos
  BASEOS_TAG        : stream9
  IMAGES_TO_BUILD   : daemon-base
  STAGING_DIR       : staging/main-centos-9-x86_64
  RELEASE           : 2fb63752
  DAEMON_BASE_IMAGE : quay.io/ceph/daemon-base:2fb63752-main-centos-stream9-x86_64
  DAEMON_IMAGE      : quay.io/ceph/daemon:2fb63752-main-centos-stream9-x86_64
  DEMO_IMAGE        : quay.io/ceph/demo:2fb63752-main-centos-stream9-x86_64

Computed:
  BASE_IMAGE        : quay.io/centos/centos:stream9

File staging/main-centos-9-x86_64/daemon-base/__ENABLE_REPOS__ is missing

make: *** [Makefile:63: stage.x86_64,main,centos,9] Error 1
[vagrant@ci-1 ceph-container]$
```

Signed-off-by: Guillaume Abrioux <[email protected]>
Signed-off-by: Guillaume Abrioux <[email protected]>
This moves and split the current logic from
`ceph-releases/ALL/centos/daemon-base/__DOCKERFILE_INSTALL__`
to `ceph-releases/<ceph-release>/centos/__GANESHA_REPO`.

This will make __DOCKERFILE_INSTALL and the rendered Dockerfile a bit
more readable.

Signed-off-by: Guillaume Abrioux <[email protected]>
Similarly to x86_64, this adds a step "debug on failure"
in case of arm64 the arm64 job fails.

Signed-off-by: Guillaume Abrioux <[email protected]>
This adds a few changes in order to support building with
CentOS stream9 as base OS image.

Signed-off-by: Guillaume Abrioux <[email protected]>
For some reason, using docker makes the build fail.
Even though the image daemon-base is well built, the build for the image 'demo'
fails because it doesn't find the demon-base image.

Using podman instead of docker allows to get around this issue.

```
=== docker build quay.io/ceph/demo:demo-centos-stream8-aarch64
running cmd: sleep 30
running cmd: docker images
REPOSITORY                   TAG                     IMAGE ID       CREATED          SIZE
quay.io/ceph/daemon-base     demo-centos-8-aarch64   c280c09c778f   36 seconds ago   1.18GB
buildpack-deps               buster                  7ceeb7ee443c   11 days ago      802MB
buildpack-deps               bullseye                af4a6a6182dd   11 days ago      833MB
debian                       10                      1df4474660a1   11 days ago      114MB
debian                       11                      35073ea3b0b7   11 days ago      124MB
node                         18                      0f9df951673d   2 weeks ago      1.09GB
node                         18-alpine               9112cb38e57e   2 weeks ago      176MB
moby/buildkit                latest                  869c7038a926   3 weeks ago      172MB
node                         16                      81c6e5ef93fc   4 weeks ago      909MB
ubuntu                       20.04                   14be0685b768   5 weeks ago      72.8MB
ubuntu                       22.04                   5a81c4b8502e   5 weeks ago      77.8MB
node                         16-alpine               d22e42cbfdbb   6 weeks ago      118MB
alpine                       3.16                    5cb2da5c2391   7 weeks ago      5.54MB
alpine                       3.17                    1f73a9d63274   7 weeks ago      7.05MB
alpine                       3.18                    c1aabb73d233   7 weeks ago      7.33MB
ubuntu                       18.04                   f9a80a55f492   2 months ago     63.2MB
node                         14                      1d12470fa662   3 months ago     912MB
node                         14-alpine               0dac3dc27b1a   4 months ago     119MB
multiarch/qemu-user-static   latest                  3539aaa87393   6 months ago     305MB
running cmd: docker build -t quay.io/ceph/demo:demo-centos-stream8-aarch64 .

------
 > [internal] load metadata for quay.io/ceph/daemon-base:demo-centos-8-aarch64:
------
Dockerfile:1
--------------------
   1 | >>> FROM quay.io/ceph/daemon-base:demo-centos-8-aarch64
   2 |
   3 |     ENV I_AM_IN_A_CONTAINER 1
--------------------
ERROR: failed to solve: quay.io/ceph/daemon-base:demo-centos-8-aarch64: quay.io/ceph/daemon-base:demo-centos-8-aarch64: not found
make[1]: *** [Makefile:30: build] Error 1
make[1]: Leaving directory '/home/runner/work/ceph-container/ceph-container/staging/main-centos-arm64-8-x86_64/demo'
make: *** [Makefile:68: do.image.x86_64,main,centos-arm64,8] Error 2
Error: Process completed with exit code 2.
```

Signed-off-by: Guillaume Abrioux <[email protected]>
@guits
Copy link
Collaborator Author

guits commented Aug 10, 2023

jenkins flake8

This addresses some flake8 errors (W605, E501) in
`maint-lib/stagelib/replace.py`

Signed-off-by: Guillaume Abrioux <[email protected]>
@guits guits merged commit d090aec into main Aug 11, 2023
6 checks passed
@guits guits deleted the fix-arm64 branch August 11, 2023 05:55
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.

1 participant