Skip to content

Commit 76a9722

Browse files
Add RHEL prechecks workflow for Python 3.8 and 3.9 (#200)
* Add RHEL workflow for python 3.6 * Add workflow trigger * Change packer builder to rhel8 * Extract branch name * Get branch name * Instrall python 3.6 * Remove temporarily added scripts * Remove temporarily added trigger * Add different branch refs based on pull request or not * Uncomment ubuntu workflow * Add temporary trigger * Add RHEL8 Python3.8 scripts * Revert "Add temporary trigger" This reverts commit 65dab9e. * Add RHEL8 Python 3.9 scripts
1 parent e5d4db2 commit 76a9722

File tree

6 files changed

+72
-5
lines changed

6 files changed

+72
-5
lines changed

.github/workflows/prechecks-unix.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- "*.md"
88
- "windows/**"
99
- "libvirt/**"
10+
- "unix/prechecks/**"
1011

1112
jobs:
1213
ubuntu:
@@ -47,7 +48,7 @@ jobs:
4748
runs-on: ubuntu-latest
4849
strategy:
4950
matrix:
50-
python-version: [ '3.6' ]
51+
python-version: [ '3.6', '3.8', '3.9' ]
5152
env:
5253
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
5354
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

unix/prechecks/rhel8/rhel8.pkr.hcl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ variable current_branch_name {
3535

3636

3737
source "amazon-ebs" "rhel8" {
38-
ami_name = "machine-stats-prechecls-rhel8"
38+
ami_name = "machine-stats-prechecls-rhel8-python-${var.packer_python_version}"
3939
instance_type = "t2.micro"
4040
region = "${var.aws_region}"
4141
access_key = "${var.aws_access_key}"
@@ -51,8 +51,9 @@ source "amazon-ebs" "rhel8" {
5151
owners = ["309956199498"]
5252
}
5353
ssh_username = "ec2-user"
54-
force_deregister = true
55-
force_delete_snapshot = true
54+
force_deregister = true
55+
force_delete_snapshot = true
56+
skip_save_build_region = true
5657
}
5758

5859

unix/prechecks/rhel8/scripts/rhel8-python-3.6.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -x
33

4-
echo ++ Install Python36
4+
echo ++ Install Python3.6 and pip
55
sudo yum install -y python36
66
sudo pip3 install --upgrade pip
77

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
set -x
3+
4+
echo ++ Install required dependencies
5+
sudo yum install -y gcc openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel
6+
7+
echo ++ Install Python3.8
8+
cd /opt
9+
sudo curl -O https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tgz && sudo tar xzf Python-3.8.12.tgz
10+
11+
# echo ++ Updating PATH
12+
export PATH=/usr/local/bin:$PATH
13+
14+
cd Python-3.8.12
15+
sudo ./configure --enable-optimizations
16+
sudo make altinstall
17+
18+
# ### Check installed python versions ##
19+
#sudo ls /usr/local/bin/python*
20+
21+
echo ++ Install pipenv
22+
pip3.8 install pipenv
23+
24+
echo ++ Check packaging
25+
cd /home/ec2-user/machine_stats/unix
26+
pipenv install --python /usr/local/bin/python3.8
27+
28+
echo ++ Run machine stats
29+
pipenv run machine-stats -h
30+
31+
echo ++++ DONE ++++
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
set -x
3+
4+
echo ++ Install required dependencies
5+
sudo yum install -y gcc openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel
6+
7+
echo ++ Install Python3.9
8+
cd /opt
9+
sudo curl -O https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz && sudo tar xzf Python-3.9.6.tgz
10+
11+
# echo ++ Updating PATH
12+
export PATH=/usr/local/bin:$PATH
13+
14+
cd Python-3.9.6
15+
sudo ./configure --enable-optimizations
16+
sudo make altinstall
17+
18+
# ### Check installed python versions ##
19+
#sudo ls /usr/local/bin/python*
20+
21+
echo ++ Install pipenv
22+
pip3.9 install pipenv
23+
24+
echo ++ Check packaging
25+
cd /home/ec2-user/machine_stats/unix
26+
pipenv install --python /usr/local/bin/python3.9
27+
28+
echo ++ Run machine stats
29+
pipenv run machine-stats -h
30+
31+
echo ++++ DONE ++++

unix/prechecks/rhel8/scripts/setup.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ sudo yum -y update
77
echo ++ Install git
88
sudo yum install -y git
99

10+
echo ++ Install required dependencies
11+
sudo yum groupinstall -y 'Development Tools'
12+
1013
echo ++ Clone machine stats repo
1114
git clone https://github.com/tidalmigrations/machine_stats.git /home/ec2-user/machine_stats
1215
cd /home/ec2-user/machine_stats

0 commit comments

Comments
 (0)