Skip to content

Commit 39d76f6

Browse files
committed
Update ansible playbook for chromium build
This commit introduces a few changes to the playbook to make recreating the build process on different setups better. * Debug log at various steps in case credentials expire or ssh connections timeout * Creating an internet gateway in accounts which don't have that * Being able to run the build process in account with no default VPC * Filtering for the latest al2023 AMI if not present
1 parent 87ac75c commit 39d76f6

File tree

5 files changed

+343
-16
lines changed

5 files changed

+343
-16
lines changed

_/ansible/Makefile

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
1-
.PHONY: ansible chromium
1+
.PHONY: linux-dependencies python-dependencies build get-chrome build-chrome compress-and-download-chrome teardown
22

3-
dependencies:
3+
linux-dependencies:
44
sudo apt install python3-pip zip
5-
pip install ansible boto boto3 aws-sam-cli
65
echo "Docker is also required in order to test the package, please install docker or Docker Desktop"
76

7+
python-dependencies:
8+
pip install ansible boto boto3 aws-sam-cli
9+
810
build:
911
ansible-playbook plays/chromium.yml -i inventory.ini
12+
13+
only-get-chrome:
14+
ansible-playbook plays/chromium.yml -i inventory.ini --tags get-chrome
15+
16+
only-build-chrome:
17+
ansible-playbook plays/chromium.yml -i inventory.ini --tags build-chrome
18+
19+
only-compress-and-download-chrome:
20+
ansible-playbook plays/chromium.yml -i inventory.ini --tags compress-and-download-chrome
21+
22+
only-teardown:
23+
ansible-playbook plays/chromium.yml -i inventory.ini --tags teardown

_/ansible/README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,41 @@ To compile a specific version of Chromium, update the `chromium_revision` variab
1414
chromium_revision=1056772
1515
```
1616

17+
See here for chrome versions: https://chromiumdash.appspot.com/fetch_releases?channel=Stable&platform=Linux
18+
1719
## Usage
1820

1921
```shell
20-
AWS_REGION=us-east-1 \
22+
# setup required deps (linux or go your own way)
23+
make linux-dependencies
24+
# setup build reqs
25+
make python-dependencies
26+
2127
AWS_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXX \
2228
AWS_SECRET_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \
23-
make chromium
29+
make build
2430
```
2531

2632
## Requirements
2733

2834
- [Ansible](http://docs.ansible.com/ansible/latest/intro_installation.html#latest-releases-via-apt-ubuntu)
2935
- AWS SDK for Python (`boto` and `boto3`)
36+
37+
38+
## Troubleshooting
39+
40+
#### Dangling images?
41+
42+
See what's running with the following (replacing the region as needed.)
43+
```shell
44+
aws ec2 describe-instances --region us-west-2 --filters "Name=tag:Name,Values=Chromium" --query "Reservations[*].Instances[*].[InstanceId,State.Name,PublicIpAddress]" --output table
45+
```
46+
47+
#### Host already running?
48+
49+
Add your ip under the `[aws]` section in `inventory.ini`
50+
51+
```ini
52+
[aws]
53+
your.instance.ip.address
54+
```

_/ansible/ansible.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ host_key_checking = false
44
retry_files_enabled = false
55

66
[ssh_connection]
7-
ssh_args = -C -o ControlMaster=auto -o ControlPersist=60 -o ServerAliveInterval=30
7+
ssh_args = -C -o ControlMaster=auto -o ControlPersist=60 -o ServerAliveInterval=30 -o ServerAliveCountMax=10 -o ConnectTimeout=30
88
pipelining = true
9+
retries = 3

_/ansible/inventory.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
[localhost:vars]
55
ansible_connection=local
66
ansible_python_interpreter=python
7-
image=ami-06c68f701d8090592
8-
aws_region=us-east-1
7+
; image=ami-06c68f701d8090592
8+
aws_region=us-west-2 ; cheaper than us-east-1
99
instance_size=c7i.12xlarge
1010

1111
[aws]

0 commit comments

Comments
 (0)