Skip to content

06.Version-cache - Environment settings#13024

Open
Kalimuthu-Velappan wants to merge 1 commit intosonic-net:masterfrom
Kalimuthu-Velappan:ARCH_SETTINGS
Open

06.Version-cache - Environment settings#13024
Kalimuthu-Velappan wants to merge 1 commit intosonic-net:masterfrom
Kalimuthu-Velappan:ARCH_SETTINGS

Conversation

@Kalimuthu-Velappan
Copy link
Copy Markdown
Contributor

  • ARCH flags are not passed correctly to version cache framework.
  • Added required environment variables to the cache framework.

Why I did it

How I did it

How to verify it

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211

Description for the changelog

Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

xumia
xumia previously approved these changes Dec 12, 2022
@Kalimuthu-Velappan
Copy link
Copy Markdown
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

- ARCH flags are not passed correctly to version cache framework.
- Added required environment variables to the cache framework.
- Fixed the uncleaned cache file copy code from version script due to merge.
@xumia
Copy link
Copy Markdown
Collaborator

xumia commented Dec 21, 2022

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@xumia
Copy link
Copy Markdown
Collaborator

xumia commented Dec 21, 2022

Need to rerun it for armhf agent pool change.

@Kalimuthu-Velappan
Copy link
Copy Markdown
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@kv-y
Copy link
Copy Markdown
Contributor

kv-y commented Jan 23, 2023

@Kalimuthu-Velappan @xumia

In December new commits for vcache were merged and now we have 2 sonic-slave-images after build finished.

sonic-slave-bullseye              bc6ac16e263   38cab04607b5   47 seconds ago   6.03GB
tmp-sonic-slave-bullseye          bc6ac16e263   4bd80d159d7d   51 seconds ago   6.03GB

Some cleanup scripts can failed because they expect slave images have pattern sonic-slave-*:

images=$(docker images 'sonic-slave-*' -a -q)

Should we fix this?

@Kalimuthu-Velappan
Copy link
Copy Markdown
Contributor Author

Kalimuthu-Velappan commented Jan 23, 2023 via email

@kv-y
Copy link
Copy Markdown
Contributor

kv-y commented Jan 23, 2023

Also probably need to fix make clean.
My temporary solution from #12713 doesn't work anymore after #12005 was merged.

make clean
....
rm: cannot remove 'target/versions/dockers/docker-router-advertiser': Is a directory
make: *** [slave.mk:1512: target/docker-router-advertiser.gz-clean] Error 1
make[1]: *** [Makefile.work:567: clean] Error 2

@k-v1
Copy link
Copy Markdown
Contributor

k-v1 commented Mar 17, 2023

rsync is installed now for every build to every docker image:

DISTRO=${DISTRO} apt-get update && apt-get install -y rsync

but we remove rsync from docker containers only if vcache is enabled:

if [ ! -z "$(get_version_cache_option)" ]; then
#Delete the rsync package files
if [[ ! ${IMAGENAME} =~ -slave- ]]; then
/usr/bin/apt-get purge -y --auto-remove rsync

I think need to fix it and install rsync only if vcache is enabled.

Also auto-generated code is inserted in Dockerfiles above line:
COPY ["sources.list.{{ CONFIGURED_ARCH }}", "/etc/apt/sources.list"]
As a result we install rsync not from selected debian mirror but from default mirror (deb.debian.org) used in debian:bullseye docker image.

@k-v1
Copy link
Copy Markdown
Contributor

k-v1 commented May 11, 2023

  1. For make clean command issue I created this PR [Build] Fix make clean command #14406
  2. To remove tmp-sonic-slave docker image we can -f flag here:
    docker rmi tmp-${DOCKER_IMAGE_TAG}
  3. For rsync issue this PR was merged: [Build] don't install rsync if vcache is disabled #14407
    But still need to test how we install rsync when vcache is enabled.
    For some Dockerfiles command apt-get update && apt-get install -y rsync is inserted above this step:
    COPY ["sources.list.{{ CONFIGURED_ARCH }}", "/etc/apt/sources.list"]

    As a result we do apt-get update and install rsync from default debian mirror like deb.debian.org.
    After that we change debian mirror to correct and install other packages from correct mirror.
    This bug probably should also be fixed.


# Select version files for SHA calculation
VERSION_FILES="${SRC_VERSION_PATH}/dockers/${DOCKER_IMAGE_NAME}/versions-*-${DISTRO}-${ARCH} ${SRC_VERSION_PATH}/default/versions-*"
VERSION_FILES="${SRC_VERSION_PATH}/dockers/${DOCKER_IMAGE_NAME/-dbg/}/versions-*-${DISTRO}-${ARCH} ${SRC_VERSION_PATH}/default/versions-*"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If I try to build broadcom I get cat: 'files/build/versions/dockers/sonic-slave-bullseye/versions-*-bullseye-amd64': No such file or directory when calculate sha1sum hash below.
It's because version file for amd64 doesn't have arch suffix:
versions-deb-bullseye versions-deb-bullseye-arm64 versions-deb-bullseye-armhf versions-py3
Should we fix this?

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.

5 participants