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

Pin 7.x branch #2795 #2799

Merged
merged 4 commits into from
Sep 21, 2021
Merged
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
5 changes: 0 additions & 5 deletions bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@ def update(operation, verbose=None, upgrade=False, offline=False, optional_requi
path = os.path.dirname(__file__) or '.'
_log.info('%sing required packages', 'Build' if wheeling else 'Install')

# We must install wheel first to eliminate a bunch of scary looking
# errors at first install.
# TODO Look towards fixing the packaging so that it works with 0.31
pip('install', ['wheel==0.30'], verbose, True, offline=offline)

# Build option_requirements separately to pass install options
build_option = '--build-option' if wheeling else '--install-option'
for requirement, options in option_requirements:
Expand Down
144 changes: 52 additions & 92 deletions requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,102 +36,62 @@
# under Contract DE-AC05-76RL01830
# }}}

# These need to be importable by bootstrap.py. If we put them in
# setup.py the import may fail if setuptools in not installed
# in the global python3.

option_requirements = [
('pyzmq', ['--zmq=bundled']),
]
extras_require = { 'crate': ['crate==0.26.0'],
'databases': [ 'mysql-connector-python-rf==2.2.2',
'pymongo==3.7.2',
'bson==0.5.7',
'crate==0.26.0',
'influxdb==5.3.1',
'psycopg2-binary==2.8.6'],
'dnp3': ['pydnp3'],
'documentation': [ 'mock==4.0.3',
'Sphinx==4.1.2',
'sphinx-rtd-theme==0.5.2',
'sphinx==3.3.0',
'm2r2==0.3.1'],
'drivers': [ 'pymodbus==2.3.0',
'bacpypes==0.16.7',
'modbus-tk==1.1.1',
'pyserial==3.4'],
'influxdb': ['influxdb==5.3.1'],
'market': ['numpy==1.19.5', 'transitions==0.8.8'],
'mongo': ['pymongo==3.7.2',
'bson==0.5.7'],
'mysql': ['mysql-connector-python-rf==2.2.2'],
'pandas': ['numpy==1.19.5', 'pandas==1.1.5'],
'postgres': ['psycopg2-binary==2.8.6'],
'testing': [ 'mock==4.0.3',
'pytest==6.2.4',
'pytest-timeout==1.4.2',
'websocket-client==1.2.1',
'deepdiff==5.5.0'],
'weather': ['Pint==0.17'],
'web': [ 'ws4py==0.5.1',
'PyJWT==1.7.1',
'Jinja2==2.11.2',
'passlib==1.7.2',
'argon2-cffi==20.1.0',
'Werkzeug==1.0.1']}

install_requires = [
'gevent==20.6.1',
'grequests',
'greenlet==0.4.16',
install_requires = [ 'gevent==20.6.0',
'grequests==0.6.0',
'idna<3,>=2.5',
'requests==2.23.0',
'ply',
'psutil',
'python-dateutil',
'pytz',
'PyYAML',
'pyzmq',
'setuptools',
'tzlocal',
'ply==3.11',
'psutil==5.7.0',
'python-dateutil==2.8.1',
'pytz==2020.1',
'PyYAML==5.3.1',
'pyzmq==19.0.1',
'setuptools==39.0.1',
'tzlocal==2.1',
'pyOpenSSL==19.0.0',
'cryptography==2.3',
# Cross platform way of handling changes in file/directories.
# https://github.com/Bogdanp/watchdog_gevent
'watchdog-gevent',
'wheel==0.30'
]
'watchdog-gevent==0.1.1',
'wheel==0.30']

option_requirements = [('wheel==0.30'), ('pyzmq==19.0.1', ['--zmq=bundled'])]



extras_require = {
'crate': [ # crate databases
'crate'
],
'databases': [ # Support for all known databases
'mysql-connector-python-rf',
'pymongo',
'crate',
'influxdb',
'psycopg2-binary'
],
'dnp3': [ # dnp3 agent requirements.
'pydnp3'
],
'documentation': [ # Requirements for building the documentation
'mock',
'mysql-connector-python-rf',
'psutil',
'pymongo',
'Sphinx',
'recommonmark',
'sphinx-rtd-theme'
],
'drivers': [
'pymodbus',
'bacpypes==0.16.7',
'modbus-tk',
'pyserial'
],
'influxdb': [ # influxdb historian requirements.
'influxdb'
],
'market': [ # Requirements for the market service
'numpy',
'transitions',
],
'mongo': [ # mongo databases
'pymongo',
],
'mysql': [ # mysql databases
'mysql-connector-python-rf',
],
'pandas': [ # numpy and pandas for applications
'numpy',
'pandas',
],
'postgres': [ # numpy and pandas for applications
'psycopg2-binary'
],
'testing': [ # Testing infrastructure dependencies
'mock',
'pytest',
'pytest-timeout',
'websocket-client',
# Allows us to compare nested dictionaries easily.
'deepdiff'
],
'web': [ # Web support for launching web based agents including ssl and json web tokens.
'ws4py',
'PyJWT',
'Jinja2',
'passlib',
'argon2-cffi',
'Werkzeug'
],
'weather': [
'Pint'
],
}
134 changes: 88 additions & 46 deletions scripts/rabbit_dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/usr/bin/env bash
list=( bionic artful stretch buster trusty xenial )
set -e

list=( bionic buster )
declare -A ubuntu_versions
ubuntu_versions=( ["ubuntu-16.04"]="xenial" ["ubuntu-18.04"]="bionic" ["ubuntu-20.04"]="focal")

function exit_on_error {
rc=$?
Expand All @@ -14,8 +18,8 @@ function exit_on_error {
function print_usage {
echo "
Command Usage:
<path>/rabbit_dependencies.sh <debian or centos> <distribution name or centos version>
Valid Debian distributions: ${list[@]}
<path>/rabbit_dependencies.sh <debian, raspbian, or centos> <distribution name/ubuntu-<version> or centos version>
Valid Raspbian/Debian distributions: ${list[@]} ${!ubuntu_versions[@]}
Valid centos versions: 6, 7, 8
"
exit 0
Expand All @@ -26,33 +30,39 @@ Valid centos versions: 6, 7, 8
function install_on_centos {

if [[ "$DIST" == "6" ]]; then
erlang_url='https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/21/el/6'
erlang_url='https://packagecloud.io/rabbitmq/erlang/el/6/$basearch'
erlang_package_name='erlang-21.3.8.21-1.el6.x86_64'
elif [[ "$DIST" == "7" ]]; then
erlang_url='https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/21/el/7'
erlang_url='https://packagecloud.io/rabbitmq/erlang/el/7/$basearch'
erlang_package_name='erlang-21.3.8.21-1.el7.x86_64'
elif [[ "$DIST" == "8" ]]; then
erlang_url='https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/21/el/8'
erlang_url='https://packagecloud.io/rabbitmq/erlang/el/8/$basearch'
erlang_package_name='erlang-21.3.8.21-1.el8.x86_64'
else
printf "Invalid centos version. 6, 7, and 8 are the only compatible versions\n"
print_usage
fi

repo="## In /etc/yum.repos.d/rabbitmq-erlang.repo
[rabbitmq-erlang]
name=rabbitmq-erlang
[rabbitmq_erlang]
name=rabbitmq_erlang
baseurl=$erlang_url
gpgcheck=1
gpgkey=https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
repo_gpgcheck=0
enabled=1"

if [[ ! -f "/etc/yum.repos.d/rabbitmq-erlang.repo" ]]; then
echo "$repo" | ${prefix} tee -a /etc/yum.repos.d/rabbitmq-erlang.repo
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
"
if [[ -f "/etc/yum.repos.d/rabbitmq-erlang.repo" ]]; then
echo "\n/etc/yum.repos.d/rabbitmq-erlang.repo exists. renaming current file to rabbitmq-erlang.repo.old\n"
mv /etc/yum.repos.d/rabbitmq-erlang.repo /etc/yum.repos.d/rabbitmq-erlang.repo.old
exit_on_error
else
echo "\nrepo file /etc/yum.repos.d/rabbitmq-erlang.repo already exists\n"
fi
${prefix} yum install erlang
exit_on_error
fi
echo "$repo" | ${prefix} tee -a /etc/yum.repos.d/rabbitmq-erlang.repo
${prefix} yum install $erlang_package_name
exit_on_error
}

function install_on_debian {
Expand All @@ -64,14 +74,32 @@ function install_on_debian {
fi
done

if [[ "$FOUND" != "1" ]]; then
# check if ubuntu-version was passed if so map it to name
for ubuntu_version in "${!ubuntu_versions[@]}"; do
if [[ "$DIST" == "$ubuntu_version" ]]; then
FOUND=1
DIST="${ubuntu_versions[$ubuntu_version]}"
break
fi
done
fi

if [[ "$FOUND" != "1" ]]; then
echo "Invalid distribution found"
print_usage
fi

echo "installing ERLANG"
${prefix} apt-get install apt-transport-https libwxbase3.0-0v5 libwxgtk3.0-0v5 libsctp1 build-essential python-dev openssl libssl-dev libevent-dev git
${prefix} apt-get update
if [[ "$DIST" == "xenial" ]] || [[ "$DIST" == "bionic" ]]; then
${prefix} apt-get install -y apt-transport-https libwxbase3.0-0v5 libwxgtk3.0-0v5 libsctp1 build-essential python-dev openssl libssl-dev libevent-dev git
else
${prefix} apt-get install -y apt-transport-https libwxbase3.0-0v5 libwxgtk3.0-gtk3-0v5 libsctp1 build-essential python-dev openssl libssl-dev libevent-dev git
fi
set +e
${prefix} apt-get purge -yf erlang*
set -e
# Add the signing key
wget -O- https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | ${prefix} apt-key add -

Expand All @@ -80,33 +108,44 @@ function install_on_debian {
fi

version=${erlang_package_version}
common_deb_pkgs="\
erlang-asn1=$version \
erlang-base=$version \
erlang-crypto=$version \
erlang-diameter=$version \
erlang-edoc=$version \
erlang-eldap=$version \
erlang-erl-docgen=$version \
erlang-eunit=$version \
erlang-inets=$version \
erlang-mnesia=$version \
erlang-odbc=$version \
erlang-os-mon=$version \
erlang-parsetools=$version \
erlang-public-key=$version \
erlang-runtime-tools=$version \
erlang-snmp=$version \
erlang-ssh=$version \
erlang-ssl=$version \
erlang-syntax-tools=$version \
erlang-tools=$version \
erlang-xmerl=$version \
"
x86_pkgs="\
erlang-ic=$version \
erlang-inviso=$version \
erlang-percept=$version \
"
to_install=""
if [[ $is_arm == "FALSE" ]]; then
to_install="${common_deb_pkgs} ${x86_pkgs}"
else
to_install="${common_deb_pkgs}"
fi

${prefix} apt-get update
${prefix} apt-get install -yf
${prefix} apt-get install -y "erlang-asn1=$version" \
"erlang-base=$version" \
"erlang-crypto=$version" \
"erlang-diameter=$version" \
"erlang-edoc=$version" \
"erlang-eldap=$version" \
"erlang-erl-docgen=$version" \
"erlang-eunit=$version" \
"erlang-ic=$version" \
"erlang-inets=$version" \
"erlang-inviso=$version" \
"erlang-mnesia=$version" \
"erlang-odbc=$version" \
"erlang-os-mon=$version" \
"erlang-parsetools=$version" \
"erlang-percept=$version" \
"erlang-public-key=$version" \
"erlang-runtime-tools=$version" \
"erlang-snmp=$version" \
"erlang-ssh=$version" \
"erlang-ssl=$version" \
"erlang-syntax-tools=$version" \
"erlang-tools=$version" \
"erlang-xmerl=$version"

${prefix} apt-get install -y ${to_install}
${prefix} apt-get install -y "erlang-nox=$version"
}

Expand All @@ -118,14 +157,17 @@ if [[ ${user} == 'root' ]]; then
else
prefix="sudo"
fi
is_arm="FALSE"

${prefix} pwd > /dev/null

if [[ "$os_name" == "debian" ]]; then
erlang_package_version="1:22.1.8.1-1"
is_arm="FALSE"
install_on_debian
elif [[ "$os_name" == "raspbian" ]]; then
erlang_package_version="1:21.2.6+dfsg-1"
is_arm="TRUE"
install_on_debian
elif [[ "$os_name" == "centos" ]]; then
install_on_centos
Expand Down