Skip to content

Commit 4e45bf7

Browse files
committed
FEATURE: udpate sles11 squashfs python and python packages. Added jsoncomment.
foundation-python is 3.8.3 foundation-python-packages is: Jinja2 Flask MarkupSafe PyMySQL Werkzeug PyYAML certifi chardet Click idna itsdangerous requests setuptools six urllib3 jsoncomment
1 parent c4774d2 commit 4e45bf7

7 files changed

Lines changed: 31 additions & 15 deletions

File tree

common/src/foundation/python/UpdatingPython.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,17 @@ You must rebuild foundation-python and foundation-python-packages for sles11 (th
3131

3232
### Setup a sles 11 build environment.
3333

34-
Build a sles11 backend (maybe you should use stacki for this!), based off of develop (so, not with the python version change yet). Include the SLES11 SDK.
34+
Build a sles11 backend (maybe you should use stacki for this!), based off of develop (so, not with the python version change yet). Include the SLES11 SDK and OS-Updates. Install the openssl that ships with OS-Updates. `zypper install -y curl-openssl1`
3535

3636
## build the new foundation python
3737

38-
Sles11 has issues with old TLS. We have a caching proxy setup for pip to get around this. Create an /etc/pip.conf to point to our cache:
38+
Copy in the stacki source code with the new python branch and cd to it.
3939

40-
/etc/pip.conf:
40+
Sles11 has issues with old TLS. We have a caching proxy setup for pip to get around this. Copy the pip.conf with our mirror to use it in the sles11 build host:
41+
42+
`cp sles/src/stack/images/SLES/sles11/11sp3/pip.conf /etc/pip.conf`
43+
44+
> in case this file disappears or moves, here's it's contents:
4145
4246
```
4347
[global]
@@ -46,31 +50,37 @@ trusted-host = stacki-builds.labs.teradata.com
4650
disable-pip-version-check = true
4751
```
4852

49-
Copy in the stacki source code with the new python branch, `run make bootstrap; source /etc/profile.d/stack-build.sh; make bootstrap` again.
53+
Then bootstrap the build host.
54+
55+
`make bootstrap; source /etc/profile.d/stack-build.sh && make bootstrap`
5056

51-
Then build python
57+
Then build python:
5258

5359
```
5460
cd common/src/foundation/python
5561
make
5662
make install-rpm
5763
```
5864

59-
Transfer the newly built rpm to S3
65+
Transfer the newly built rpm to S3:
66+
67+
`s3cmd put foundation-python-3*rpm s3://teradata-stacki/3rdparty/`
6068

6169
## Build the initrd python packages for the new foundation python
6270

6371
On the same system sles11 system, using the new foundation-python, we'll use pip to fetch and prepare our python packages and their dependencies.
6472

65-
> note, the system will have the older version of spython installed - make sure to specify full path to new one
73+
> note, the system may have the older version of spython installed - make sure to specify full path to new one
6674
6775
```
68-
PKGS=Jinja2 Flask MarkupSafe PyMySQL Werkzeug PyYAML certifi chardet Click idna itsdangerous requests setuptools six urllib3
6976
7077
mkdir -p /tmp/initrd/opt/stack/
7178
79+
PKGS="Jinja2 Flask MarkupSafe PyMySQL Werkzeug PyYAML certifi chardet Click idna itsdangerous requests setuptools six urllib3 jsoncomment"
7280
/opt/stack/bin/pip3.8 install --ignore-installed --install-option="--prefix=/tmp/initrd/opt/stack" $PKGS
7381
82+
echo $? # to see if it failed
83+
7484
cd /tmp/initrd
7585
tar -cvzf foundation-python-packages.tar.gz opt/
7686
@@ -85,16 +95,18 @@ stack create package dir=${PWD}/opt/ prefix=/ name=foundation-python-packages re
8595

8696
You can run `rpm -qilp foundation-python-packages-*-sles11.x86_64.rpm` to test the new package and check that the paths look correct
8797

88-
Transfer the package to s3
98+
Transfer the package to s3:
99+
100+
`s3cmd put foundation-python-packages-*rpm s3://teradata-stacki/3rdparty/`
89101

90102
Update sles/3rdparty.json for the new filenames
91103

92104
## Fix the broken symlinks in the sles11 dir
93105

94106
```
95107
cd sles/src/stack/images/SLES/sles11/11sp3/RPMS/
96-
ln -s ../../../../../../../3rdparty/foundation-python-3.8.1-sles11.x86_64.rpm
97-
ln -s ../../../../../../../3rdparty/foundation-python-packages-7.0-sles11.x86_64.rpm
98108
rm foundation-python-packages-*-sles11.x86_64.rpm
99109
rm foundation-python-*-sles11.x86_64.rpm
110+
ln -s ../../../../../../../3rdparty/foundation-python-3.8.1-sles11.x86_64.rpm
111+
ln -s ../../../../../../../3rdparty/foundation-python-packages-7.0-sles11.x86_64.rpm
100112
```

sles/3rdparty.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
{
33
"urlbase": "https://teradata-stacki.s3.amazonaws.com/3rdparty",
44
"files": [
5-
"foundation-python-3.8.1-sles11.x86_64.rpm",
6-
"foundation-python-packages-7.0-sles11.x86_64.rpm",
5+
"foundation-python-3.8.3-sles11.x86_64.rpm",
6+
"foundation-python-packages-8.0-sles11.x86_64.rpm",
77
"parted-2.3-10.45.1.x86_64.rpm",
88
"i40e-2.4.6.tar.gz"
99
]

sles/src/stack/images/SLES/sles11/11sp3/RPMS/foundation-python-3.8.1-sles11.x86_64.rpm

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../../../3rdparty/foundation-python-3.8.3-sles11.x86_64.rpm

sles/src/stack/images/SLES/sles11/11sp3/RPMS/foundation-python-packages-7.0-sles11.x86_64.rpm

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../../../3rdparty/foundation-python-packages-8.0-sles11.x86_64.rpm
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[global]
2+
index-url = http://stacki-builds.labs.teradata.com/pypi
3+
trusted-host = stacki-builds.labs.teradata.com
4+
disable-pip-version-check = true

0 commit comments

Comments
 (0)