Skip to content

Commit

Permalink
[dist] Create obs-cloud-uploader subpackage
Browse files Browse the repository at this point in the history
Pair-programming with: @bgeuken
  • Loading branch information
DavidKang authored and bgeuken committed Feb 20, 2018
1 parent 61c1117 commit d6a29ac
Show file tree
Hide file tree
Showing 2 changed files with 205 additions and 9 deletions.
166 changes: 166 additions & 0 deletions dist/ec2utils.conf.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# One can configure as many accounts as one chooses. Configured accounts
# start with the "account-" prefix. Account information is retrieved by any
# of the ec2utils tools by combining the prefix "account-" with the name
# specified with the --account command line option
#
# For example the information for the "account-servers" configuration is
# used by specifying --account servers on the command line of any of the
# tools
[account-servers]
access_key_id =
secret_access_key =
ssh_key_name =
ssh_private_key =
subnet_id_us-east-1 = subnet-123456

# The aki IDs are published by Amazon on the following page:
# http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedKernels.html#AmazonKernelImageIDs
# The ami, instance_type, and user are needed for those utilities that require
# a running instance in Amazon EC2 to perform their operations.
[region-ap-northeast-1]
ami = ami-383c1956
instance_type = t2.micro
aki_i386 = aki-136bf512
aki_x86_64 = aki-176bf516
g2_aki_x86_64 = aki-f1ad9bf0
user = ec2-user
# Allow a region to overwrite the account key
# ssk_key_name =
# ssh_private_key =

[region-ap-northeast-2]
ami = ami-249b554a
instance_type = t2.micro
aki_i386 = aki-01a66b6f
aki_x86_64 = aki-01a66b6f
g2_aki_x86_64 = aki-0ea66b60
user = ec2-user
# Allow a region to overwrite the account key
# ssk_key_name =
# ssh_private_key =

[region-ap-southeast-1]
ami = ami-c9b572aa
instance_type = t2.micro
aki_i386 = aki-ae3973fc
aki_x86_64 = aki-503e7402
g2_aki_x86_64 = aki-ca755498
user = ec2-user
# Allow a region to overwrite the account key
# ssk_key_name =
# ssh_private_key =

[region-ap-southeast-2]
ami = ami-48d38c2b
instance_type = t2.micro
aki_i386 = aki-cd62fff7
aki_x86_64 = aki-c362fff9
g2_aki_x86_64 = aki-8faec3b5
user = ec2-user
# Allow a region to overwrite the account key
# ssk_key_name =
# ssh_private_key =

[region-cn-north-1]
ami = ami-bcc45885
instance_type = t2.micro
aki_i386 = aki-908f1da9
aki_x86_64 = aki-9e8f1da7
g2_aki_x86_64 = aki-9c4ad8a5
user = ec2-user
# Allow a region to overwrite the account key
# ssk_key_name =
# ssh_private_key =

[region-eu-central-1]
ami = ami-bc5b48d0
instance_type = t2.micro
aki_i386 = aki-3e4c7a23
aki_x86_64 = aki-184c7a05
g2_aki_x86_64 = aki-e23f09ff
user = ec2-user
# Allow a region to overwrite the account key
# ssk_key_name =
# ssh_private_key =

[region-eu-west-1]
ami = ami-bff32ccc
instance_type = t2.micro
aki_i386 = aki-68a3451f
aki_x86_64 = aki-52a34525
g2_aki_x86_64 = aki-fce8478b
user = ec2-user
# Allow a region to overwrite the account key
# ssk_key_name =
# ssh_private_key =

[region-sa-east-1]
ami = ami-6817af04
instance_type = t2.micro
aki_i386 = aki-5b53f446
aki_x86_64 = aki-5553f448
g2_aki_x86_64 = aki-b99024a4
user = ec2-user
# Allow a region to overwrite the account key
# ssk_key_name =
# ssh_private_key =

[region-us-east-1]
#Amazon Linux
#ami = ami-4b814f22
# SLES 12
ami = ami-60b6c60a
instance_type = t2.micro
aki_i386 = aki-8f9dcae6
aki_x86_64 = aki-919dcaf8
g2_aki_x86_64 = aki-f4bc469c
user = ec2-user
backing-store = mag,ssd
# Allow a region to overwrite the account key
# ssk_key_name =
# ssh_private_key =

[region-us-east-2]
ami = ami-71ca9114
instance_type = t2.micro
aki_i386 = aki-da055ebf
aki_x86_64 = aki-d83a61bd
user = ec2-user
backing-store = ssd
# Allow a region to overwrite the account key
# ssk_key_name =
# ssh_private_key =

[region-us-gov-west-1]
ami = ami-c2b5d7e1
instance_type = t2.micro
aki_i386 = aki-1fe98d3c
aki_x86_64 = aki-1de98d3e
g2_aki_x86_64 = aki-07026424
user = ec2-user
# Allow a region to overwrite the account key
# ssk_key_name =
# ssh_private_key =

[region-us-west-1]
ami = ami-d5ea86b5
instance_type = t2.micro
aki_i386 = aki-8e0531cb
aki_x86_64 = aki-880531cd
g2_aki_x86_64 = aki-f9786dbc
user = ec2-user
# Allow a region to overwrite the account key
# ssk_key_name =
# ssh_private_key =

[region-us-west-2]
ami = ami-f0091d91
instance_type = t2.micro
aki_i386 = aki-f08f11c0
aki_x86_64 = aki-fc8f11cc
g2_aki_x86_64 = aki-5f125d6f
user = ec2-user
# Allow a region to overwrite the account key
# ssk_key_name =
# ssh_private_key =

48 changes: 39 additions & 9 deletions dist/obs-server.spec
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,17 @@ This package contains test cases for testing a installed appliances.
* checks if database setup worked correctly
* checks if required service came up properly

%package -n obs-cloud-uploader
Summary: The Open Build Service -- Image Cloud Uploader
Requires: obs-server
Requires: python3-boto3
Requires: python3-ec2uploadimg
Requires: python3-ec2utilsbase
Group: Productivity/Networking/Web/Utilities

%description -n obs-cloud-uploader
This package contains all the necessary tools for upload images to the cloud.

#--------------------------------------------------------------------------------
%prep

Expand Down Expand Up @@ -339,6 +350,10 @@ if ! test -L %{buildroot}/usr/lib/obs/server/build; then
exit 1
fi

install -m 755 $RPM_BUILD_DIR/open-build-service-%version/dist/clouduploader.rb $RPM_BUILD_ROOT/%{_bindir}
mkdir -p $RPM_BUILD_ROOT/etc/obs/cloudupload
install -m 644 $RPM_BUILD_DIR/open-build-service-%version/dist/ec2utils.conf.example $RPM_BUILD_ROOT/etc/obs/cloudupload/ec2utils.conf

%check
%if 0%{?disable_obs_test_suite}
echo "WARNING:"
Expand Down Expand Up @@ -405,23 +420,33 @@ getent passwd obsrun >/dev/null || \
exit 0

%preun
%stop_on_removal obssrcserver obsrepserver obsdispatcher obsscheduler obspublisher obswarden obssigner obsdodup obsservicedispatch obsservice obsclouduploadworker obsclouduploadserver
%stop_on_removal obssrcserver obsrepserver obsdispatcher obsscheduler obspublisher obswarden obssigner obsdodup obsservicedispatch obsservice

%service_del_preun obsdeltastore

%preun -n obs-worker
%stop_on_removal obsworker

%preun -n obs-cloud-uploader
%stop_on_removal obsclouduploadworker obsclouduploadserver

%post
%if 0%{?suse_version} >= 1315
%reload_on_update obssrcserver obsrepserver obsdispatcher obspublisher obswarden obssigner obsdodup obsservicedispatch obsservice obsclouduploadworker obsclouduploadserver
%reload_on_update obssrcserver obsrepserver obsdispatcher obspublisher obswarden obssigner obsdodup obsservicedispatch obsservice
%else
%restart_on_update obssrcserver obsrepserver obsdispatcher obspublisher obswarden obssigner obsdodup obsservicedispatch obsservice obsclouduploadworker obsclouduploadserver
%restart_on_update obssrcserver obsrepserver obsdispatcher obspublisher obswarden obssigner obsdodup obsservicedispatch obsservice
%endif
# systemd kills the init script executing the reload first on reload....
%restart_on_update obsscheduler
%service_add_post obsdeltastore

%post -n obs-cloud-uploader
%if 0%{?suse_version} >= 1315
%reload_on_update obsservice obsclouduploadworker obsclouduploadserver
%else
%restart_on_update obsservice obsclouduploadworker obsclouduploadserver
%endif

%posttrans
[ -d /srv/obs ] || install -d -o obsrun -g obsrun /srv/obs
# this changes from directory to symlink. rpm can not handle this itself.
Expand Down Expand Up @@ -502,8 +527,6 @@ chown %{apache_user}:%{apache_group} /srv/www/obs/api/log/production.log
%{_unitdir}/obsdeltastore.service
/etc/init.d/obsservicedispatch
/etc/init.d/obssigner
/etc/init.d/obsclouduploadworker
/etc/init.d/obsclouduploadserver
/usr/sbin/obs_admin
/usr/sbin/obs_serverstatus
/usr/sbin/rcobsdispatcher
Expand All @@ -516,8 +539,6 @@ chown %{apache_user}:%{apache_group} /srv/www/obs/api/log/production.log
/usr/sbin/rcobsdeltastore
/usr/sbin/rcobsservicedispatch
/usr/sbin/rcobssigner
/usr/sbin/rcobsclouduploadworker
/usr/sbin/rcobsclouduploadserver
/usr/lib/obs/server/plugins
/usr/lib/obs/server/BSDispatcher
/usr/lib/obs/server/BSRepServer
Expand Down Expand Up @@ -549,8 +570,6 @@ chown %{apache_user}:%{apache_group} /srv/www/obs/api/log/production.log
/usr/lib/obs/server/bs_worker
/usr/lib/obs/server/bs_signer
/usr/lib/obs/server/bs_warden
/usr/lib/obs/server/bs_clouduploadserver
/usr/lib/obs/server/bs_clouduploadworker
/usr/lib/obs/server/worker
/usr/lib/obs/server/worker-deltagen.spec
%config(noreplace) /usr/lib/obs/server/BSConfig.pm
Expand Down Expand Up @@ -698,6 +717,17 @@ usermod -a -G docker obsservicerun
%dir /usr/lib/obs/tests/appliance
/usr/lib/obs/tests/appliance/*

%files -n obs-cloud-uploader
%defattr(-,root,root)
/etc/init.d/obsclouduploadworker
/etc/init.d/obsclouduploadserver
/usr/sbin/rcobsclouduploadworker
/usr/sbin/rcobsclouduploadserver
/usr/lib/obs/server/bs_clouduploadserver
/usr/lib/obs/server/bs_clouduploadworker
%{_bindir}/clouduploader.rb
%dir /etc/obs/cloudupload/
%config(noreplace) /etc/obs/cloudupload/ec2utils.conf

%package -n obs-container-registry
Summary: The Open Build Service -- container registry
Expand Down

0 comments on commit d6a29ac

Please sign in to comment.