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

Upgrade the Agent build to embed Python 3.8.1 #4464

Merged
merged 45 commits into from
Feb 3, 2020
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
a518ae7
Upgrade to Python 3.8
remeh Nov 13, 2019
e86a831
Update Python 3.8 hash (Linux).
remeh Nov 13, 2019
8e6ff1a
Update python3 shasum for windows.
remeh Nov 15, 2019
c79cdab
Merge branch 'master' into remeh/python-3.8
remeh Nov 15, 2019
2952536
Patch must be applied to Python 3.8 now.
remeh Nov 15, 2019
b354bdf
Update sha256 to reflect new zips
derekwbrown Nov 15, 2019
49406d1
omnibus: update pip3.
remeh Nov 18, 2019
a829a05
Merge branch 'remeh/python-3.8' of github.com:DataDog/datadog-agent i…
remeh Nov 18, 2019
aa0f231
omnibus: in order to use a more recent pip, we need a more recent pip…
remeh Nov 20, 2019
fd75ce0
Release note entry.
remeh Nov 20, 2019
776b240
Apply suggestions from code review
remeh Jan 8, 2020
47a07c8
Update releasenotes/notes/python-3-8-c66cde69f972eb1e.yaml
remeh Jan 8, 2020
7af37bf
tasks: use `distro` instead of `platform` to get running linux distri…
remeh Jan 8, 2020
9a6b8c7
gitlab-ci: install requirements deps for invoke tasks.
remeh Jan 8, 2020
a708eb0
Revert "gitlab-ci: install requirements deps for invoke tasks."
remeh Jan 8, 2020
6347fbe
gitlab-ci: use new builders shipping `distro` dep for invoke tasks.
remeh Jan 8, 2020
f27327c
gitlab-ci: ebpf tests also need the distro dep
remeh Jan 8, 2020
f7bf60e
gitlab-ci: builders images.
remeh Jan 8, 2020
08fd40a
general: update python 3 to 3.8.1
remeh Jan 8, 2020
3ad269a
gitlab-ci: install `distro` dep for python 3 in tests ebpf job.
remeh Jan 8, 2020
51ba077
Merge branch 'master' into remeh/python-3.8
remeh Jan 8, 2020
0fbb6e4
gitlab-ci: merge WINBUILDIMAGES and BUILDERS vars.
remeh Jan 8, 2020
d8fad95
omnibus: python3.8.1 checksum.
remeh Jan 8, 2020
c906689
gitlab-ci: merge ARMBUILDIMAGES and BUILDIMAGES env vars.
remeh Jan 8, 2020
68564e2
omnibus/python3: update sha256sum of windows archives.
remeh Jan 21, 2020
ad35a0b
empty commit, can't find my pipeline
remeh Jan 24, 2020
0289aa7
Merge remote-tracking branch 'origin/master' into remeh/python-3.8
remeh Jan 27, 2020
e6d26ff
tasks: python 3.8 compliant.
remeh Jan 27, 2020
054c974
omnibus/python3: update wheel dep to 0.34.1
remeh Jan 28, 2020
aec9feb
appveyor: configure appveyor to use python 3.8
remeh Jan 28, 2020
aaf1e76
python3: updated python 3.8.1 32bits for windows sha256sum
remeh Jan 28, 2020
b139ce4
omnibus/pkg-scripts: remove downloader data for both 3.7 & 3.8 pythons
remeh Jan 29, 2020
3a7f9bb
omnibus: remove pythons download data at the right moment only.
remeh Jan 29, 2020
427eba3
omnibus: properly call remove_downlaoder_data for centos.
remeh Jan 29, 2020
e989e67
Merge branch 'master' into remeh/python-3.8
remeh Jan 29, 2020
b730297
gitlab: use new builders images.
remeh Jan 30, 2020
0d841b7
gitlab: use builders images merged in master.
remeh Jan 30, 2020
e3e0a80
gitlab-ci: use the requirements.txt while installing distro for the e…
remeh Jan 31, 2020
0ac14bb
tasks/build_tags: proper entry for redhat since we switched to distro…
remeh Jan 31, 2020
de4142d
packages-scripts: also remove python 3.8 in preinst
remeh Jan 31, 2020
8dc2f7c
Revert "omnibus: properly call remove_downlaoder_data for centos."
remeh Jan 31, 2020
4fdc101
releasesnotes: update python 3.8.1 release note entry.
remeh Jan 31, 2020
71f51ad
Update releasenotes/notes/python-3-8-c66cde69f972eb1e.yaml
remeh Feb 3, 2020
df362eb
releasenotes: adapt python 3.8.1 release note entry.
remeh Feb 3, 2020
ca1e959
releasenotes: remove mention of a7 py version.
remeh Feb 3, 2020
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
17 changes: 9 additions & 8 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ variables:
S3_DSD6_URI: s3://dsd6-staging/linux
RELEASE_VERSION_6: nightly
RELEASE_VERSION_7: nightly
DATADOG_AGENT_BUILDIMAGES: v2028839-bd64f94
DATADOG_AGENT_BUILDERS: v2093589-8bb07dc
DATADOG_AGENT_WINBUILDIMAGES: v2068298-dc0e899
DATADOG_AGENT_ARMBUILDIMAGES: v2028839-bd64f94
DATADOG_AGENT_BUILDIMAGES: v2123669-fbee190
DATADOG_AGENT_BUILDERS: v2123666-a884483
DATADOG_AGENT_WINBUILDIMAGES: v2123666-a884483
DATADOG_AGENT_ARMBUILDIMAGES: v2123669-fbee190


# Default before_script for all the jobs. If you create a new job and don't want this to execute
Expand Down Expand Up @@ -276,6 +276,7 @@ run_tests_ebpf:
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-builders/ebpf:go1.10.1
before_script:
- cd $SRC_PATH
- pip3 install distro -c requirements.txt # needed for some of our invoke tasks until the builders image contain it
- inv -e deps --verbose --dep-vendor-only
tags: [ "runner:main", "size:large" ]
script:
Expand Down Expand Up @@ -352,7 +353,7 @@ build_dogstatsd-deb_x64:
# build dogstatsd static for deb-arm
build_dogstatsd_static-deb_arm64:
stage: binary_build
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_arm64:$DATADOG_AGENT_ARMBUILDIMAGES
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_arm64:$DATADOG_AGENT_BUILDIMAGES
remeh marked this conversation as resolved.
Show resolved Hide resolved
tags: ["runner:docker-arm", "platform:arm64"]
needs: [ "fail_on_non_triggered_tag", "run_tests_deb-x64-py3" ]
variables:
Expand All @@ -371,7 +372,7 @@ build_dogstatsd_static-deb_arm64:
# build dogstatsd linked for deb-arm
build_dogstatsd-deb_arm64:
stage: binary_build
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_arm64:$DATADOG_AGENT_ARMBUILDIMAGES
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_arm64:$DATADOG_AGENT_BUILDIMAGES
tags: ["runner:docker-arm", "platform:arm64"]
needs: [ "fail_on_non_triggered_tag", "run_tests_deb-x64-py3" ]
variables:
Expand Down Expand Up @@ -403,7 +404,7 @@ build_puppy_agent-deb_x64:
# build puppy agent for ARM, to make sure the build is not broken because of build targets
build_puppy_agent-deb_arm64:
stage: binary_build
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_arm64:$DATADOG_AGENT_ARMBUILDIMAGES
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_arm64:$DATADOG_AGENT_BUILDIMAGES
tags: ["runner:docker-arm", "platform:arm64"]
needs: [ "fail_on_non_triggered_tag", "run_tests_deb-x64-py3" ]
variables:
Expand Down Expand Up @@ -440,7 +441,7 @@ cluster_agent-build_amd64:

cluster_agent-build_arm64:
<<: *cluster_agent-build_common
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_arm64:$DATADOG_AGENT_ARMBUILDIMAGES
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_arm64:$DATADOG_AGENT_BUILDIMAGES
tags: ["runner:docker-arm", "platform:arm64"]
variables:
ARCH: arm64
Expand Down
6 changes: 3 additions & 3 deletions docs/dev/agent_dev_env.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ development files to be available in the dev env. The Agent can embed Python2
and/or Python3, you will need development files for all versions you want to
support.

If you're on OSX/macOS, installing Python 2.7 and/or 3.7 with [Homebrew](https://brew.sh) will
bring along all the development files needed:
If you're on OSX/macOS, installing Python 2.7 and/or 3.8 with [Homebrew](https://brew.sh)
brings along all the development files needed:
```
brew install python@2
brew install python@3
Expand All @@ -21,7 +21,7 @@ sudo apt-get install python2.7-dev
sudo apt-get install python2.3-dev
```

On Windows, install Python 2.7 and/or 3.7 via the [official installer](https://www.python.org/downloads/).
On Windows, install Python 2.7 and/or 3.8 via the [official installer](https://www.python.org/downloads/).

### Additional Windows Tools
You will also need the Visual Studio for [Visual Studio for Python installer](http://aka.ms/vcpython27)
Expand Down
10 changes: 5 additions & 5 deletions omnibus/config/software/datadog-agent-integrations-py3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
end

relative_path 'integrations-core'
whitelist_file "embedded/lib/python3.7/site-packages/psycopg2"
whitelist_file "embedded/lib/python3.7/site-packages/pymqi"
whitelist_file "embedded/lib/python3.8/site-packages/psycopg2"
whitelist_file "embedded/lib/python3.8/site-packages/pymqi"

source git: 'https://github.com/DataDog/integrations-core.git'

Expand Down Expand Up @@ -100,8 +100,8 @@
# Prepare the build env, these dependencies are only needed to build and
# install the core integrations.
#
command "#{pip} install wheel==0.30.0"
command "#{pip} install pip-tools==2.0.2"
command "#{pip} install wheel==0.34.1"
command "#{pip} install pip-tools==4.2.0"
uninstall_buildtime_deps = ['rtloader', 'click', 'first', 'pip-tools']
nix_build_env = {
"CFLAGS" => "-I#{install_dir}/embedded/include -I/opt/mqm/inc",
Expand Down Expand Up @@ -259,7 +259,7 @@
if windows?
patch :source => "jpype_0_7.patch", :target => "#{python_3_embedded}/Lib/site-packages/jaydebeapi/__init__.py"
else
patch :source => "jpype_0_7.patch", :target => "#{install_dir}/embedded/lib/python3.7/site-packages/jaydebeapi/__init__.py"
patch :source => "jpype_0_7.patch", :target => "#{install_dir}/embedded/lib/python3.8/site-packages/jaydebeapi/__init__.py"
end

end
Expand Down
10 changes: 5 additions & 5 deletions omnibus/config/software/python3.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name "python3"

default_version "3.7.6"
default_version "3.8.1"

if ohai["platform"] != "windows"
dependency "libffi"
Expand All @@ -13,7 +13,7 @@
dependency "libyaml"

source :url => "https://python.org/ftp/python/#{version}/Python-#{version}.tgz",
:sha256 => "aeee681c235ad336af116f08ab6563361a0c81c537072c1b309d6e4050aa2114"
:sha256 => "c7cfa39a43b994621b245e029769e9126caa2a93571cee2e743b213cceac35fb"

relative_path "Python-#{version}"

Expand Down Expand Up @@ -48,7 +48,7 @@
command python_configure.join(" "), :env => env
command "make -j #{workers}", :env => env
command "make install", :env => env
delete "#{install_dir}/embedded/lib/python3.7/test"
delete "#{install_dir}/embedded/lib/python3.8/test"

# There exists no configure flag to tell Python to not compile readline support :(
major, minor, bugfix = version.split(".")
Expand All @@ -65,12 +65,12 @@
dependency "vc_ucrt_redist"

source :url => "http://s3.amazonaws.com/dd-agent-omnibus/python-windows-#{version}-x86.zip",
:sha256 => "946335d0f15e0c4c2820b5ce1ecd4b6470b8f6f28b774d4572279f2d0478c8ab"
:sha256 => "44f4a665392912fe172223c42c62dd193670392fee5010bc9f89c5cd2722964c"
else

# note that startring with 3.7.3 on Windows, the zip should be created without the built-in pip
source :url => "https://s3.amazonaws.com/dd-agent-omnibus/python-windows-#{version}-amd64.zip",
:sha256 => "618325664cadaa80766a3c89f480904bbf23fcbb61467ec36c5d87be026c00cf"
:sha256 => "58563ca60891025923572107e02b8f07439928eb5222dd10466cc92089072c2a"

end
build do
Expand Down
11 changes: 8 additions & 3 deletions omnibus/package-scripts/agent/preinst
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,14 @@ if [ "$DISTRIBUTION" != "Darwin" ]; then
rm -rf $DOWNLOADER_DATA
fi

DOWNLOADER_DATA3="$INSTALL_DIR/embedded/lib/python3.7/site-packages/datadog_checks/downloader/data"
if [ -d $DOWNLOADER_DATA3 ]; then
rm -rf $DOWNLOADER_DATA3
DOWNLOADER_DATA37="$INSTALL_DIR/embedded/lib/python3.7/site-packages/datadog_checks/downloader/data"
if [ -d $DOWNLOADER_DATA37 ]; then
rm -rf $DOWNLOADER_DATA37
fi

DOWNLOADER_DATA38="$INSTALL_DIR/embedded/lib/python3.8/site-packages/datadog_checks/downloader/data"
if [ -d $DOWNLOADER_DATA38 ]; then
rm -rf $DOWNLOADER_DATA38
fi
else
echo "[ FAILED ]\tYour system is currently not supported by this script.";
Expand Down
6 changes: 3 additions & 3 deletions omnibus/package-scripts/agent/prerm
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ remove_downloader_data()
rm -rf $DOWNLOADER_DATA
fi

DOWNLOADER_DATA3="$INSTALL_DIR/embedded/lib/python3.7/site-packages/datadog_checks/downloader/data"
if [ -d $DOWNLOADER_DATA3 ]; then
rm -rf $DOWNLOADER_DATA3
DOWNLOADER_DATA38="$INSTALL_DIR/embedded/lib/python3.8/site-packages/datadog_checks/downloader/data"
if [ -d $DOWNLOADER_DATA38 ]; then
rm -rf $DOWNLOADER_DATA38
fi
}

Expand Down
14 changes: 14 additions & 0 deletions releasenotes/notes/python-3-8-c66cde69f972eb1e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Each section from every release note is combined when the
# CHANGELOG.rst is rendered. Therefore, the text should be worded in a way
# that does not depend on any information available in another
# section. This may mean repeating some details, but each section
# must be readable independently of the other.
#
# Each section note must be formatted as reStructuredText.
---
enhancements:
- |
Upgrade embedded Python 3 to 3.8.1
olivielpeau marked this conversation as resolved.
Show resolved Hide resolved
Link to Python 3.8 changelog: https://docs.python.org/3/whatsnew/3.8.html
Agent v6 will continue to ship both Python 2 & 3, respectively version 2.7.17 (unchanged) and 3.8.1
remeh marked this conversation as resolved.
Show resolved Hide resolved
Agent v7 will ship Python 3.8.1
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ docker==3.0.1
requests==2.20.1
PyYAML==5.1
toml==0.9.4
distro==1.4.0
2 changes: 1 addition & 1 deletion rtloader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Most of the code used to extend the embedded interpreter is there.

* C/C++ compiler
* Python 2.7.x development packages
* Python 3.7.x development packages
* Python 3.8.x development packages
* Cmake version 3.12 or above
* Go compiler with `cgo` capabilities to run the tests

Expand Down
2 changes: 1 addition & 1 deletion rtloader/appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ environment:
GOPATH: C:\gopath
# Give hints to CMake to find Pythons
Python2_ROOT_DIR: C:\Python27-x64
Python3_ROOT_DIR: C:\Python37-x64
Python3_ROOT_DIR: C:\Python38-x64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this appears to be 3.8.0 (not 3.8.1). I'm not sure it matters, but to get 3.8.1 we'd have to install our own python at test-time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup I've been with the best-effort for appveyor. Would it be complicated to have a 3.8.1? They'll probably update it soon anyway?

PIP2: pip2 -q
PIP3: pip3 -q
MSYS_ROOT: C:\msys64
Expand Down
4 changes: 2 additions & 2 deletions tasks/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import os
import shutil
import sys
import platform
import distro
from distutils.dir_util import copy_tree

import invoke
Expand Down Expand Up @@ -103,7 +103,7 @@ def build(ctx, rebuild=False, race=False, build_include=None, build_exclude=None
build_exclude.append(ex)

# remove all tags that are only available on debian distributions
distname = platform.linux_distribution()[0].lower()
distname = distro.id().lower()
olivielpeau marked this conversation as resolved.
Show resolved Hide resolved
if distname not in REDHAT_AND_DEBIAN_DIST:
for ex in REDHAT_AND_DEBIAN_ONLY_TAGS:
if ex not in build_exclude:
Expand Down
4 changes: 2 additions & 2 deletions tasks/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import os
import shutil
import sys
import platform
import distro
from distutils.dir_util import copy_tree

import invoke
Expand Down Expand Up @@ -63,7 +63,7 @@ def build(ctx, rebuild=False, race=False, build_include=None, build_exclude=None
build_exclude.append(ex)

# remove all tags that are only available on debian distributions
distname = platform.linux_distribution()[0].lower()
distname = distro.id().lower()
if distname not in REDHAT_AND_DEBIAN_DIST:
for ex in REDHAT_AND_DEBIAN_ONLY_TAGS:
if ex not in build_exclude:
Expand Down
6 changes: 3 additions & 3 deletions tasks/build_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Utilities to manage build tags
"""
import sys
import platform
import distro
from invoke import task

# ALL_TAGS lists any available build tag
Expand Down Expand Up @@ -55,7 +55,7 @@
REDHAT_AND_DEBIAN_DIST = [
'centos',
'debian',
'redhat',
'rhel',
'ubuntu',
]

Expand All @@ -77,7 +77,7 @@ def get_default_build_tags(puppy=False, process=False):
exclude = exclude + PROCESS_ONLY_TAGS

# remove all tags that are only available on debian distributions
distname = platform.linux_distribution()[0].lower()
distname = distro.id().lower()
if distname not in REDHAT_AND_DEBIAN_DIST:
exclude = exclude + REDHAT_AND_DEBIAN_ONLY_TAGS

Expand Down
8 changes: 4 additions & 4 deletions tasks/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def _stringify_version(version_dict):
.format(version_dict["major"],
version_dict["minor"],
version_dict["patch"])
if version_dict["rc"] is not 0:
if version_dict["rc"] != 0:
version = "{}-rc.{}".format(version, version_dict["rc"])
return version

Expand Down Expand Up @@ -296,15 +296,15 @@ def create_new_version(

if not integration_version:
integration_version = _get_highest_repo_version(auth, "integrations-core", highest_version, version_re)
if integration_version["rc"] is not 0:
if integration_version["rc"] != 0:
print("ERROR: Integration-Core tag is still and RC tag. That's probably NOT what you want in the final artifact. Aborting.")
#return Exit(code=1)
integration_version = _stringify_version(integration_version)
print("Integration-Core's tag is {}".format(integration_version))

if not omnibus_software_version:
omnibus_software_version = _get_highest_repo_version(auth, "omnibus-software", highest_version, version_re)
if omnibus_software_version["rc"] is not 0:
if omnibus_software_version["rc"] != 0:
print("ERROR: Omnibus-Software tag is still and RC tag. That's probably NOT what you want in the final artifact. Aborting.")
#return Exit(code=1)
omnibus_software_version = _stringify_version(omnibus_software_version)
Expand Down Expand Up @@ -403,4 +403,4 @@ def create_rc(
integration_version,
omnibus_software_version,
omnibus_ruby_version,
jmxfetch_version)
jmxfetch_version)