7.5.2. Mirroring Packages¶
7.5.2.1. Getting Started¶
Follow the instructions in Environment Preparation if you have not done that yet.
Note
The following steps must be done on the container hosting system unless you have nested container capabilities in your build container.
7.5.2.2. Install Bolt¶
See the documentation at puppetlabs/bolt to install bolt on your system.
7.5.2.3. Create the Pulp Cloning System¶
Using puppetlabs/bolt and simp/bolt-pulp3, set up the pulp container.
git clone https://github.com/simp/bolt-pulp3
cd bolt-pulp3
rvm use system # You can skip this if not using RVM
/opt/puppetlabs/bolt/bin/bolt module install --force
/opt/puppetlabs/bolt/bin/gem install --user -g gem.deps.rb
/opt/puppetlabs/bolt/bin/bolt plan run pulp3::in_one_container
# Wait a few minutes for the service to get fully started
7.5.2.4. Clone the Packages¶
This uses a configuration file from the target version of SIMP that you are going to build.
You will either need to download the file from simp/simp-core or clone the repository and checkout the git tag that you wish to build.
For example, if you are going to build CentOS 8 for SIMP 6.6.0:
curl -O https://raw.githubusercontent.com/simp/simp-core/6.6.0-1/build/distributions/CentOS/8/x86_64/bolt_pulp3_config.yaml
./slim-pulp-repo-copy.rb -f bolt_pulp3_config.yaml
or:
Note
You can change the url
keys in the packages YAML file if you wish to use
alternate servers.
7.5.2.4.1. Troubleshooting¶
7.5.2.4.1.1. Repo Clone Hangs¶
Occasionally, there are issues with the upstream repos that require the pulp container to be restarted.
The most common one is when the clone process hangs and continually prints that
it is in status Waiting
.
If this occurs:
podman stop pulp
podman start pulp
# Wait a few minutes for the service to get fully started
./slim-pulp-repo-copy.rb -f build/6.6.0/CentOS/8/x86_64/repo_packages.yaml
7.5.2.4.1.2. Updated YAML file¶
If you have updated your YAML file, you will need to flush and re-clone the repositories so that you don’t pull stale packages.
To do this:
rm -rf output
rm -rf _download_data # Only if the reposync has been run
/opt/puppetlabs/bolt/bin/bolt plan run pulp3::in_one_container::destroy
/opt/puppetlabs/bolt/bin/bolt plan run pulp3::in_one_container
# Wait a few minutes for the service to get fully started
./slim-pulp-repo-copy.rb -f build/6.6.0/CentOS/8/x86_64/repo_packages.yaml
7.5.2.4.1.3. If the slim-pulp-repo-copy.rb Fails¶
If the slim-pulp-repo-copy.rb fails for any reason, the pulp container could be in an unknown state. To ensure that nothing from the failed run will cause issues with future runs, do the following:
This will ensure that the container is removed and recreated in a fresh state.
7.5.2.5. Copy the Repo Contents¶
Once the clone process has completed, you need to copy the cloned packages out of the repository for use in the rest of the build process.
To do so:
cd output
./_slim_repos.*reposync.sh
7.5.2.6. Copy the Packages Into the Build Container¶
You now need to copy the files into the build container for use during the build process.
podman cp _download_path/ simp_build_centos8:/tmp
podman exec -it simp_build_centos8 chown -R build_user:build_user /tmp/_download_path