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

[WIP] Bundle container images from plugins in an RPM #455

Open
wants to merge 3 commits into
base: master
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
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ RUN ARCH=$(uname -m) && \
libxslt-devel \
make \
openssl-devel \
podman \
python3-devel \
python3-pip \
python3-virtualenv \
Expand Down
2 changes: 2 additions & 0 deletions bin/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@

puts "\n\nTARBALL BUILT SUCCESSFULLY"

ManageIQ::RPMBuild::BuildContainers.new.build

# Build RPMs
release_name = build_type == "release" ? git_ref : ""
ManageIQ::RPMBuild::BuildCopr.new(release_name).generate_rpm
Expand Down
1 change: 1 addition & 0 deletions lib/manageiq/rpm_build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class String

require 'manageiq/rpm_build/helper'
require 'manageiq/rpm_build/build_copr'
require 'manageiq/rpm_build/build_containers'
require 'manageiq/rpm_build/build_hotfix'
require 'manageiq/rpm_build/build_uploader'
require 'manageiq/rpm_build/generate_ansible_venv'
Expand Down
19 changes: 19 additions & 0 deletions lib/manageiq/rpm_build/build_containers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module ManageIQ
module RPMBuild
class BuildContainers
include Helper

attr_reader :manifest_dir

def initialize
where_am_i

@manifest_dir = MANIFEST_DIR
end

def build
where_am_i
end
end
end
end
17 changes: 17 additions & 0 deletions rpm_spec/manageiq.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,22 @@ ln -s ./python3 %{buildroot}%{ansible_venv_root}/venv/bin/python
# Copy manifest
%{__cp} %{ansible_venv_builddir}/ansible_venv_manifest.csv %{buildroot}%{manifest_root}

#############################
# Install docker containers #
#############################

%{__mkdir} -p %{buildroot}%{_sharedstatedir}/manageiq/data/containers
for gem_dir in %{gemset_builddir}/bundler/gems/*; do
if [[ ! -L $gem_dir ]]; then
for container_image in $gem_dir/content/containers/*; do
echo $container_image
if [[ -d $container_image ]]; then
echo "Loading $container_image"
podman load --root=%{buildroot}%{_sharedstatedir}/manageiq/data/containers/storage --input $container_image
fi
done
fi
done

%clean
rm -rf $RPM_BUILD_ROOT
11 changes: 11 additions & 0 deletions rpm_spec/subpackages/manageiq-containers
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
%package containers
Summary: %{product_summary} Containers

%description containers
%{product_summary} Containers

%files
%{_sharedstatedir}/manageiq/data/containers

%post containers
# TODO podman image import --root=/var/lib/manageiq/data/containers/storage /tmp/opentofu-runner_latest.tar
1 change: 1 addition & 0 deletions rpm_spec/subpackages/manageiq-gemset-services
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ done

%files gemset-services
%{_prefix}/lib/systemd/system/manageiq-providers*
%{_prefix}/lib/systemd/system/opentofu-runner*