Skip to content

Commit 2f4b0b3

Browse files
committed
Changes made as per review comment
2 parents fe05a2f + 9477d5c commit 2f4b0b3

File tree

12 files changed

+123
-101
lines changed

12 files changed

+123
-101
lines changed

packages/st2/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ endif
2222

2323
ifeq ($(DEB_DISTRO),bionic)
2424
PYTHON_BINARY := /usr/bin/python3
25-
PIP_BINARY := pip
25+
PIP_BINARY := /usr/local/bin/pip3.6
2626
else ifeq ($(DEB_DISTRO),xenial)
2727
PYTHON_BINARY := /usr/bin/python3.6
2828
PIP_BINARY := /usr/local/bin/pip3.6

packages/st2/component.makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ endif
2121

2222
ifeq ($(DEB_DISTRO),bionic)
2323
PYTHON_BINARY := /usr/bin/python3
24-
PIP_BINARY := /usr/bin/pip3
24+
PIP_BINARY := /usr/local/bin/pip3.6
2525
else ifeq ($(DEB_DISTRO),xenial)
2626
PYTHON_BINARY := /usr/bin/python3.6
2727
PIP_BINARY := /usr/local/bin/pip3.6
@@ -54,6 +54,7 @@ info:
5454
@echo "PIP_BINARY=$(PIP_BINARY)"
5555
@echo "EL_VERSION=$(EL_VERSION)"
5656
@echo "EL_DISTRO=$(EL_DISTRO)"
57+
$(PIP_BINARY) --version
5758

5859
.PHONY: populate_version requirements wheelhouse bdist_wheel
5960
all: info populate_version requirements bdist_wheel

packages/st2/debian/rules

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ endif
2727
%:
2828
# Use Python 3 binary on Ubuntu Bionic
2929
ifeq ($(DEB_DISTRO),bionic)
30-
dh $@ --with python-virtualenv --python /usr/bin/python3
30+
dh $@ --with python-virtualenv --python /usr/bin/python3.6
3131
else ifeq ($(DEB_DISTRO),xenial)
3232
dh $@ --with python-virtualenv --python /usr/bin/python3.6
3333
endif
@@ -67,7 +67,10 @@ override_dh_virtualenv:
6767
#
6868
# NB! Use '--no-download' arg for 'virtualenv' is required,
6969
# otherwise it downloads latest PIP version instead of bundled/pinned one.
70+
# --force-pip-version is needed to ensure correct pip version is installed
71+
# inside dh virtualenv
7072
dh_virtualenv --extra-virtualenv-arg='--no-download' \
73+
--force-pip-version='20.0.2' \
7174
--extra-pip-arg '--find-links=$(WHEELDIR)' \
7275
--extra-pip-arg '--no-index' --no-test
7376

rake/build/package_st2.rake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace :package do
99
with opts.env do
1010
opts.components.each do |component|
1111
within ::File.join(opts.gitdir, component) do
12+
make :info, label: "make info"
1213
make :bdist_wheel, label: "bdist: #{component}"
1314
end
1415
end

rpmspec/package_venv.spec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
%define venv_bin %{venv_dir}/bin
99

1010
%define venv_python %{venv_bin}/python3
11-
%define pin_pip %{venv_python} %{venv_bin}/pip3 install pip==19.1.1
11+
# https://github.com/StackStorm/st2/wiki/Where-all-to-update-pip-and-or-virtualenv
12+
%define pin_pip %{venv_python} %{venv_bin}/pip3 install pip==20.0.2
1213
%define install_venvctrl python3 -m pip install venvctrl
1314
%if 0%{?rhel} == 8
1415
%define install_crypto %{venv_python} %{venv_bin}/pip install cryptography==2.8 --no-binary cryptography

scripts/st2_bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ PASSWORD=''
1616
EXTRA_OPTS=''
1717

1818
# Note: This variable needs to default to a branch of the latest stable release
19-
BRANCH='v3.3'
19+
BRANCH='v3.4'
2020
FORCE_BRANCH=""
2121

2222
adddate() {

scripts/st2bootstrap-deb.sh

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -126,32 +126,23 @@ setup_args() {
126126
sudo apt-get update > /dev/null 2>/dev/null
127127
# check if python3.6 is available
128128
if (! apt-cache show python3.6 2> /dev/null | grep 'Package:' > /dev/null); then
129-
if [[ "$U16_ADD_INSECURE_PY3_PPA" = "1" ]]; then
130-
choice=y
131-
else
129+
if [[ "$U16_ADD_INSECURE_PY3_PPA" = "0" ]]; then
132130
echo ""
133131
echo "WARNING!"
134132
echo "The python3.6 package is a required dependency for the StackStorm st2 package but that is not installable from any of the default Ubuntu 16.04 repositories."
135133
echo "We recommend switching to Ubuntu 18.04 LTS (Bionic) as a base OS. Support for Ubuntu 16.04 will be removed with future StackStorm versions."
136134
echo ""
137135
echo "Alternatively we'll try to add python3.6 from the 3rd party 'deadsnakes' repository: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa."
138-
echo "By continuing you are aware of the support and security risks associated with using unofficial 3rd party PPA repository, and you understand that StackStorm does NOT provide ANY support for python3.6 packages on Ubuntu 16.04."
139136
echo ""
140-
echo "To bypass this check in future, you can provide the following flag: --u16-add-insecure-py3-ppa"
137+
echo "You can provide the following flag os use python3.6 from the 'deadsnakes'repository: --u16-add-insecure-py3-ppa"
138+
echo ""
139+
echo "By using the flag you are aware of the support and security risks associated with using unofficial 3rd party PPA repository, and you understand that StackStorm does NOT provide ANY support for python3.6 packages on Ubuntu 16.04."
141140
echo ""
142-
echo "Press [y] to continue or [n] to cancel adding it: "
143-
read choice
141+
exit 1
142+
else
143+
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F23C5A6CF475977595C89F51BA6932366A755776
144+
echo "deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/deadsnakes-ubuntu-ppa-xenial.list
144145
fi
145-
case "$choice" in
146-
y|Y )
147-
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F23C5A6CF475977595C89F51BA6932366A755776
148-
echo "deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/deadsnakes-ubuntu-ppa-xenial.list
149-
;;
150-
* )
151-
echo "python3.6 PPA installation aborted"
152-
exit 1
153-
;;
154-
esac
155146
fi
156147
fi
157148
}
@@ -476,11 +467,18 @@ install_st2_dependencies() {
476467
fi
477468

478469
sudo apt-get install -y curl
470+
471+
# Various other dependencies needed by st2 and installer script
472+
sudo apt-get install -y crudini
473+
}
474+
475+
install_rabbitmq() {
476+
# install RabbitMQ
479477
sudo apt-get install -y rabbitmq-server
480478
sudo rabbitmqctl add_user stanley "${ST2_RABBITMQ_PASSWORD}"
481479
sudo rabbitmqctl delete_user guest
482-
rabbitmqctl set_user_tags stanley administrator
483-
rabbitmqctl set_permissions -p / stanley ".*" ".*" ".*"
480+
sudo rabbitmqctl set_user_tags stanley administrator
481+
sudo rabbitmqctl set_permissions -p / stanley ".*" ".*" ".*"
484482

485483
# Configure RabbitMQ to listen on localhost only
486484
sudo sh -c 'echo "RABBITMQ_NODE_IP_ADDRESS=127.0.0.1" >> /etc/rabbitmq/rabbitmq-env.conf'
@@ -490,9 +488,6 @@ install_st2_dependencies() {
490488
else
491489
sudo service rabbitmq-server restart
492490
fi
493-
494-
# Various other dependencies needed by st2 and installer script
495-
sudo apt-get install -y crudini
496491
}
497492

498493
install_mongodb() {
@@ -612,8 +607,7 @@ install_st2() {
612607
sudo crudini --set /etc/st2/st2.conf database password "${ST2_MONGODB_PASSWORD}"
613608

614609
# Configure [messaging] section in st2.conf (username password for RabbitMQ access)
615-
RABBITMQHOST="${RABBITMQHOST:-rabbitmq}"
616-
AMQP="amqp://stanley:$ST2_RABBITMQ_PASSWORD@$RABBITMQHOST:5672/"
610+
AMQP="amqp://stanley:$ST2_RABBITMQ_PASSWORD@127.0.0.1:5672"
617611
sudo crudini --set /etc/st2/st2.conf messaging url "${AMQP}"
618612

619613
sudo st2ctl start
@@ -716,6 +710,7 @@ STEP="Check TCP ports and MongoDB storage requirements" && check_st2_host_depend
716710
STEP="Generate random password" && generate_random_passwords
717711
STEP="Configure Proxy" && configure_proxy
718712
STEP="Install st2 dependencies" && install_st2_dependencies
713+
STEP="Install st2 dependencies (RabbitMQ)" && install_rabbitmq
719714
STEP="Install st2 dependencies (MongoDB)" && install_mongodb
720715
STEP="Install st2" && install_st2
721716
STEP="Configure st2 user" && configure_st2_user

scripts/st2bootstrap-deb.template.sh

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -118,32 +118,23 @@ setup_args() {
118118
sudo apt-get update > /dev/null 2>/dev/null
119119
# check if python3.6 is available
120120
if (! apt-cache show python3.6 2> /dev/null | grep 'Package:' > /dev/null); then
121-
if [[ "$U16_ADD_INSECURE_PY3_PPA" = "1" ]]; then
122-
choice=y
123-
else
121+
if [[ "$U16_ADD_INSECURE_PY3_PPA" = "0" ]]; then
124122
echo ""
125123
echo "WARNING!"
126124
echo "The python3.6 package is a required dependency for the StackStorm st2 package but that is not installable from any of the default Ubuntu 16.04 repositories."
127125
echo "We recommend switching to Ubuntu 18.04 LTS (Bionic) as a base OS. Support for Ubuntu 16.04 will be removed with future StackStorm versions."
128126
echo ""
129127
echo "Alternatively we'll try to add python3.6 from the 3rd party 'deadsnakes' repository: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa."
130-
echo "By continuing you are aware of the support and security risks associated with using unofficial 3rd party PPA repository, and you understand that StackStorm does NOT provide ANY support for python3.6 packages on Ubuntu 16.04."
131128
echo ""
132-
echo "To bypass this check in future, you can provide the following flag: --u16-add-insecure-py3-ppa"
129+
echo "You can provide the following flag os use python3.6 from the 'deadsnakes'repository: --u16-add-insecure-py3-ppa"
130+
echo ""
131+
echo "By using the flag you are aware of the support and security risks associated with using unofficial 3rd party PPA repository, and you understand that StackStorm does NOT provide ANY support for python3.6 packages on Ubuntu 16.04."
133132
echo ""
134-
echo "Press [y] to continue or [n] to cancel adding it: "
135-
read choice
133+
exit 1
134+
else
135+
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F23C5A6CF475977595C89F51BA6932366A755776
136+
echo "deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/deadsnakes-ubuntu-ppa-xenial.list
136137
fi
137-
case "$choice" in
138-
y|Y )
139-
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F23C5A6CF475977595C89F51BA6932366A755776
140-
echo "deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/deadsnakes-ubuntu-ppa-xenial.list
141-
;;
142-
* )
143-
echo "python3.6 PPA installation aborted"
144-
exit 1
145-
;;
146-
esac
147138
fi
148139
fi
149140
}
@@ -163,11 +154,18 @@ install_st2_dependencies() {
163154
fi
164155

165156
sudo apt-get install -y curl
157+
158+
# Various other dependencies needed by st2 and installer script
159+
sudo apt-get install -y crudini
160+
}
161+
162+
install_rabbitmq() {
163+
# install RabbitMQ
166164
sudo apt-get install -y rabbitmq-server
167165
sudo rabbitmqctl add_user stanley "${ST2_RABBITMQ_PASSWORD}"
168166
sudo rabbitmqctl delete_user guest
169-
rabbitmqctl set_user_tags stanley administrator
170-
rabbitmqctl set_permissions -p / stanley ".*" ".*" ".*"
167+
sudo rabbitmqctl set_user_tags stanley administrator
168+
sudo rabbitmqctl set_permissions -p / stanley ".*" ".*" ".*"
171169

172170
# Configure RabbitMQ to listen on localhost only
173171
sudo sh -c 'echo "RABBITMQ_NODE_IP_ADDRESS=127.0.0.1" >> /etc/rabbitmq/rabbitmq-env.conf'
@@ -177,9 +175,6 @@ install_st2_dependencies() {
177175
else
178176
sudo service rabbitmq-server restart
179177
fi
180-
181-
# Various other dependencies needed by st2 and installer script
182-
sudo apt-get install -y crudini
183178
}
184179

185180
install_mongodb() {
@@ -299,8 +294,7 @@ install_st2() {
299294
sudo crudini --set /etc/st2/st2.conf database password "${ST2_MONGODB_PASSWORD}"
300295

301296
# Configure [messaging] section in st2.conf (username password for RabbitMQ access)
302-
RABBITMQHOST="${RABBITMQHOST:-rabbitmq}"
303-
AMQP="amqp://stanley:$ST2_RABBITMQ_PASSWORD@$RABBITMQHOST:5672/"
297+
AMQP="amqp://stanley:$ST2_RABBITMQ_PASSWORD@127.0.0.1:5672"
304298
sudo crudini --set /etc/st2/st2.conf messaging url "${AMQP}"
305299

306300
sudo st2ctl start
@@ -403,6 +397,7 @@ STEP="Check TCP ports and MongoDB storage requirements" && check_st2_host_depend
403397
STEP="Generate random password" && generate_random_passwords
404398
STEP="Configure Proxy" && configure_proxy
405399
STEP="Install st2 dependencies" && install_st2_dependencies
400+
STEP="Install st2 dependencies (RabbitMQ)" && install_rabbitmq
406401
STEP="Install st2 dependencies (MongoDB)" && install_mongodb
407402
STEP="Install st2" && install_st2
408403
STEP="Configure st2 user" && configure_st2_user

scripts/st2bootstrap-el7.sh

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -494,18 +494,7 @@ install_st2_dependencies() {
494494
if [[ -z "$is_epel_installed" ]]; then
495495
sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
496496
fi
497-
sudo yum -y install curl rabbitmq-server
498-
sudo rabbitmqctl add_user stanley "${ST2_RABBITMQ_PASSWORD}"
499-
sudo rabbitmqctl delete_user guest
500-
rabbitmqctl set_user_tags stanley administrator
501-
rabbitmqctl set_permissions -p / stanley ".*" ".*" ".*"
502-
503-
# Configure RabbitMQ to listen on localhost only
504-
sudo sh -c 'echo "RABBITMQ_NODE_IP_ADDRESS=127.0.0.1" >> /etc/rabbitmq/rabbitmq-env.conf'
505-
506-
sudo systemctl start rabbitmq-server
507-
sudo systemctl enable rabbitmq-server
508-
497+
509498
# Various other dependencies needed by st2 and installer script
510499
sudo yum -y install crudini
511500

@@ -525,6 +514,21 @@ install_st2_dependencies() {
525514
fi
526515
}
527516

517+
install_rabbitmq() {
518+
sudo yum -y install curl rabbitmq-server
519+
520+
# Configure RabbitMQ to listen on localhost only
521+
sudo sh -c 'echo "RABBITMQ_NODE_IP_ADDRESS=127.0.0.1" >> /etc/rabbitmq/rabbitmq-env.conf'
522+
523+
sudo systemctl start rabbitmq-server
524+
sudo systemctl enable rabbitmq-server
525+
526+
sudo rabbitmqctl add_user stanley "${ST2_RABBITMQ_PASSWORD}"
527+
sudo rabbitmqctl delete_user guest
528+
sudo rabbitmqctl set_user_tags stanley administrator
529+
sudo rabbitmqctl set_permissions -p / stanley ".*" ".*" ".*"
530+
}
531+
528532
install_mongodb() {
529533
# Add key and repo for the latest stable MongoDB (4.0)
530534
sudo rpm --import https://www.mongodb.org/static/pgp/server-4.0.asc
@@ -599,8 +603,7 @@ install_st2() {
599603
sudo crudini --set /etc/st2/st2.conf database password "${ST2_MONGODB_PASSWORD}"
600604

601605
# Configure [messaging] section in st2.conf (username password for RabbitMQ access)
602-
RABBITMQHOST="${RABBITMQHOST:-rabbitmq}"
603-
AMQP="amqp://stanley:$ST2_RABBITMQ_PASSWORD@$RABBITMQHOST:5672/"
606+
AMQP="amqp://stanley:$ST2_RABBITMQ_PASSWORD@127.0.0.1:5672"
604607
sudo crudini --set /etc/st2/st2.conf messaging url "${AMQP}"
605608

606609
sudo st2ctl start
@@ -720,6 +723,7 @@ STEP='Install repoquery tool' && install_yum_utils
720723
STEP="Generate random password" && generate_random_passwords
721724

722725
STEP="Install st2 dependencies" && install_st2_dependencies
726+
STEP="Install st2 dependencies (RabbitMQ)" && install_rabbitmq
723727
STEP="Install st2 dependencies (MongoDB)" && install_mongodb
724728
STEP="Install st2" && install_st2
725729
STEP="Configure st2 user" && configure_st2_user

scripts/st2bootstrap-el7.template.sh

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -131,18 +131,7 @@ install_st2_dependencies() {
131131
if [[ -z "$is_epel_installed" ]]; then
132132
sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
133133
fi
134-
sudo yum -y install curl rabbitmq-server
135-
sudo rabbitmqctl add_user stanley "${ST2_RABBITMQ_PASSWORD}"
136-
sudo rabbitmqctl delete_user guest
137-
rabbitmqctl set_user_tags stanley administrator
138-
rabbitmqctl set_permissions -p / stanley ".*" ".*" ".*"
139-
140-
# Configure RabbitMQ to listen on localhost only
141-
sudo sh -c 'echo "RABBITMQ_NODE_IP_ADDRESS=127.0.0.1" >> /etc/rabbitmq/rabbitmq-env.conf'
142-
143-
sudo systemctl start rabbitmq-server
144-
sudo systemctl enable rabbitmq-server
145-
134+
146135
# Various other dependencies needed by st2 and installer script
147136
sudo yum -y install crudini
148137

@@ -162,6 +151,21 @@ install_st2_dependencies() {
162151
fi
163152
}
164153

154+
install_rabbitmq() {
155+
sudo yum -y install curl rabbitmq-server
156+
157+
# Configure RabbitMQ to listen on localhost only
158+
sudo sh -c 'echo "RABBITMQ_NODE_IP_ADDRESS=127.0.0.1" >> /etc/rabbitmq/rabbitmq-env.conf'
159+
160+
sudo systemctl start rabbitmq-server
161+
sudo systemctl enable rabbitmq-server
162+
163+
sudo rabbitmqctl add_user stanley "${ST2_RABBITMQ_PASSWORD}"
164+
sudo rabbitmqctl delete_user guest
165+
sudo rabbitmqctl set_user_tags stanley administrator
166+
sudo rabbitmqctl set_permissions -p / stanley ".*" ".*" ".*"
167+
}
168+
165169
install_mongodb() {
166170
# Add key and repo for the latest stable MongoDB (4.0)
167171
sudo rpm --import https://www.mongodb.org/static/pgp/server-4.0.asc
@@ -236,8 +240,7 @@ install_st2() {
236240
sudo crudini --set /etc/st2/st2.conf database password "${ST2_MONGODB_PASSWORD}"
237241

238242
# Configure [messaging] section in st2.conf (username password for RabbitMQ access)
239-
RABBITMQHOST="${RABBITMQHOST:-rabbitmq}"
240-
AMQP="amqp://stanley:$ST2_RABBITMQ_PASSWORD@$RABBITMQHOST:5672/"
243+
AMQP="amqp://stanley:$ST2_RABBITMQ_PASSWORD@127.0.0.1:5672"
241244
sudo crudini --set /etc/st2/st2.conf messaging url "${AMQP}"
242245

243246
sudo st2ctl start
@@ -357,6 +360,7 @@ STEP='Install repoquery tool' && install_yum_utils
357360
STEP="Generate random password" && generate_random_passwords
358361

359362
STEP="Install st2 dependencies" && install_st2_dependencies
363+
STEP="Install st2 dependencies (RabbitMQ)" && install_rabbitmq
360364
STEP="Install st2 dependencies (MongoDB)" && install_mongodb
361365
STEP="Install st2" && install_st2
362366
STEP="Configure st2 user" && configure_st2_user

0 commit comments

Comments
 (0)