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

Add package dependencies #911

Merged
merged 9 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion .github/workflows/ci-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
run: zypper --non-interactive install rustup

- name: Install required packages
run: zypper --non-interactive install python-langtable-data openssl-3 libopenssl-3-devel jq
run: zypper --non-interactive install python-langtable-data openssl-3 libopenssl-3-devel jq

- name: Install Rust toolchains
run: rustup toolchain install stable
Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/ci-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,28 @@ jobs:
run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && zypper ref

- name: Install Ruby development files
run: zypper --non-interactive install gcc gcc-c++ make openssl-devel ruby-devel npm augeas-devel
run: zypper --non-interactive install
gcc
gcc-c++
make
openssl-devel
ruby-devel
augeas-devel

- name: Install required packages
run: zypper --non-interactive install yast2-iscsi-client
run: zypper --non-interactive install
suseconnect-ruby-bindings
autoyast2-installation
yast2
yast2-bootloader
yast2-country
yast2-hardware-detection
yast2-installation
yast2-iscsi-client
yast2-network
yast2-proxy
yast2-storage-ng
yast2-users

- name: Install RubyGems dependencies
run: bundle config set --local with 'development' && bundle install
Expand Down
44 changes: 34 additions & 10 deletions service/package/gem2rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,52 @@
%global rb_build_versions %{rb_default_ruby}
BuildRequires: dbus-1-common
Requires: dbus-1-common
Requires: suseconnect-ruby-bindings
# YaST dependencies
Requires: autoyast2-installation
# ArchFilter
Requires: yast2 >= 4.5.20
Requires: yast2-bootloader
Requires: yast2-country
Requires: yast2-hardware-detection
Requires: yast2-installation
Requires: yast2-iscsi-client >= 4.5.7
Requires: yast2-network
Requires: yast2-proxy
# ProposalSettings#swap_reuse
Requires: yast2-storage-ng >= 5.0.3
Requires: open-iscsi
Requires: yast2-iscsi-client >= 4.5.7
Requires: yast2-users
# required for registration
Requires: suseconnect-ruby-bindings
# yast2 with ArchFilter
Requires: yast2 >= 4.5.20
# storage dependencies
Requires: ntfs-3g
Requires: ntfsprogs
Requires: snapper
%ifarch s390 s390x
Requires: yast2-s390 >= 4.6.4
Requires: yast2-reipl
Requires: yast2-cio
%endif
# Storage dependencies
Requires: bcache-tools
Requires: btrfsprogs
Requires: cryptsetup
Requires: dmraid
Requires: dosfstools
Requires: e2fsprogs
Requires: exfat-utils
Requires: f2fs-tools
Requires: fcoe-utils
Requires: fde-tools
Requires: jfsutils
Requires: libstorage-ng-lang
Requires: lvm2
Requires: mdadm
Requires: multipath-tools
Requires: nilfs-utils
Requires: nfs-client
Requires: ntfs-3g
Requires: ntfsprogs
Requires: nvme-cli
Requires: open-iscsi
Requires: quota
Requires: snapper
Requires: udftools
Requires: xfsprogs
:filelist: "%{_datadir}/dbus-1/agama.conf\n
%dir %{_datadir}/dbus-1/agama-services\n
%{_datadir}/dbus-1/agama-services/org.opensuse.Agama*.service\n
Expand Down
101 changes: 82 additions & 19 deletions setup-service.sh → setup-services.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/bin/sh -x

# Using a git checkout in the current directory,
# set up the service (backend) part of agama
# so that it can be used by
# - the web frontend (as set up by setup.sh)
# Using a git checkout in the current directory and set up the services, so that it can be used by:
# - the web frontend (as set up by setup-web.sh)
# - the CLI
# or both

# Exit on error; unset variables are an error
# Exit on error; unset variables are an error.
set -eu

MYDIR=$(realpath $(dirname $0))
Expand All @@ -32,29 +30,94 @@ sudosed() {
sed -e "$1" "$2" | $SUDO tee "$3" > /dev/null
}

# - Install RPM dependencies

# this repo can be removed once python-language-data reaches Factory
test -f /etc/zypp/repos.d/d_l_python.repo || \
$SUDO zypper --non-interactive \
addrepo https://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_Tumbleweed/ d_l_python
$SUDO zypper --non-interactive --gpg-auto-import-keys install gcc gcc-c++ make openssl-devel ruby-devel \
python-langtable-data git augeas-devel jemalloc-devel awk suseconnect-ruby-bindings || exit 1

# only install cargo if it is not available (avoid conflicts with rustup)
which cargo || $SUDO zypper --non-interactive install cargo

# if agama is already running -> stop it
$SUDO systemctl list-unit-files agama.service &>/dev/null && $SUDO systemctl stop agama.service

# - Install service rubygem dependencies
# Ruby services

# Packages required for Ruby development (i.e., bundle install).
$SUDO zypper --non-interactive --gpg-auto-import-keys install \
gcc \
joseivanlopez marked this conversation as resolved.
Show resolved Hide resolved
gcc-c++ \
make \
openssl-devel \
ruby-devel \
augeas-devel || exit 1

# Packages required by Agama Ruby services (see ./service/package/gem2rpm.yml).
# TODO extract list from gem2rpm.yml
$SUDO zypper --non-interactive --gpg-auto-import-keys install \
dbus-1-common \
suseconnect-ruby-bindings \
autoyast2-installation \
yast2 \
yast2-bootloader \
yast2-country \
yast2-hardware-detection \
yast2-installation \
yast2-iscsi-client \
yast2-network \
yast2-proxy \
yast2-storage-ng \
yast2-users \
bcache-tools \
btrfsprogs \
cryptsetup \
dmraid \
dosfstools \
e2fsprogs \
exfat-utils \
f2fs-tools \
fcoe-utils \
fde-tools \
jfsutils \
libstorage-ng-lang \
lvm2 \
mdadm \
multipath-tools \
nilfs-utils \
nfs-client \
ntfs-3g \
ntfsprogs \
nvme-cli \
open-iscsi \
quota \
snapper \
udftools \
xfsprogs || exit 1

# Install s390 packages (do not exit on failure).
$SUDO zypper --non-interactive --gpg-auto-import-keys install \
yast2-s390 \
yast2-reipl \
yast2-cio

# Rubygem dependencies
(
cd $MYDIR/service
bundle config set --local path 'vendor/bundle'
bundle install
)

# - build also rust service
# Rust service, CLI and auto-installation.

# Only install cargo if it is not available (avoid conflicts with rustup)
which cargo || $SUDO zypper --non-interactive install cargo

# This repo can be removed once python-language-data reaches Factory.
test -f /etc/zypp/repos.d/d_l_python.repo || \
$SUDO zypper --non-interactive \
joseivanlopez marked this conversation as resolved.
Show resolved Hide resolved
addrepo https://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_Tumbleweed/ d_l_python

# Packages required by Rust code (see ./rust/package/agama-cli.spec)
$SUDO zypper --non-interactive install \
bzip2 \
jsonnet \
lshw \
python-langtable-data \
tar \
xkeyboard-config-lang || exit 1

(
cd $MYDIR/rust
cargo build
Expand Down
29 changes: 29 additions & 0 deletions setup-web.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh -x

# Exit on error; unset variables are an error.
set -eu

MYDIR=$(realpath $(dirname $0))

# Helper:
# Ensure root privileges for the installation.
# In a testing container, we are root but there is no sudo.
if [ $(id --user) != 0 ]; then
SUDO=sudo
if [ $($SUDO id --user) != 0 ]; then
echo "We are not root and cannot sudo, cannot continue."
exit 1
fi
else
SUDO=""
fi

$SUDO zypper --non-interactive --gpg-auto-import-keys install \
make \
'npm>=18' \
cockpit || exit 1

$SUDO systemctl start cockpit

cd web; make devel-install; cd -
$SUDO ln -snf `pwd`/web/dist /usr/share/cockpit/agama
34 changes: 14 additions & 20 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/sh

# This script sets up the development environment without installing any
# package. This script is supposed to run within a repository clone.
# This script sets up the development environment without installing Agama packages. This script is
# supposed to run within a repository clone.

# Exit on error; unset variables are an error
# Exit on error; unset variables are an error.
set -eu

MYDIR=$(realpath $(dirname $0))
Expand All @@ -21,29 +21,23 @@ else
SUDO=""
fi

# Backend setup

if ! $MYDIR/setup-service.sh; then
echo "Backend setup failed."
echo "Agama service is NOT running."
# Services setup
if ! $MYDIR/setup-services.sh; then
echo "Services setup failed."
echo "Agama services are NOT running."

exit 2
fi;

# Install Frontend dependencies

$SUDO zypper --non-interactive --gpg-auto-import-keys install \
make git 'npm>=18' cockpit

# Web Frontend
# Web setup
if ! $MYDIR/setup-web.sh; then
echo "Web client setup failed."
echo "Agama web client is NOT running."

$SUDO systemctl start cockpit

# set up the web UI
cd web; make devel-install; cd -
$SUDO ln -snf `pwd`/web/dist /usr/share/cockpit/agama
exit 3
fi;

# Start the installer
# Start the installer.
echo
echo "D-Bus will start the services, see journalctl for their logs."
echo "To start the services manually, logging to the terminal:"
Expand Down