[ARVADOS] created: 2.1.0-474-g99524c2ef
Git user
git at public.arvados.org
Wed Mar 3 12:00:43 UTC 2021
at 99524c2ef7404a20f3933293cb8050bae3e4d4dd (commit)
commit 99524c2ef7404a20f3933293cb8050bae3e4d4dd
Author: Javier Bértoli <jbertoli at curii.com>
Date: Wed Mar 3 08:59:22 2021 -0300
fix(compute-images): add resolver variable to json files
refs #17438
Arvados-DCO-1.1-Signed-off-by: Javier Bértoli <jbertoli at curii.com>
diff --git a/tools/compute-images/arvados-images-aws.json b/tools/compute-images/arvados-images-aws.json
index 6a1c45da2..4d757abfd 100644
--- a/tools/compute-images/arvados-images-aws.json
+++ b/tools/compute-images/arvados-images-aws.json
@@ -1,16 +1,18 @@
{
"variables": {
+ "arvados_cluster": "",
+ "associate_public_ip_address": "true",
"aws_access_key": "",
- "aws_secret_key": "",
"aws_profile": "",
- "build_environment": "aws",
- "arvados_cluster": "",
+ "aws_secret_key": "",
"aws_source_ami": "ami-04d70e069399af2e9",
+ "build_environment": "aws",
+ "public_key_file": "",
+ "reposuffix": "",
+ "resolver": "",
"ssh_user": "admin",
- "vpc_id": "",
"subnet_id": "",
- "public_key_file": "",
- "associate_public_ip_address": "true"
+ "vpc_id": ""
},
"builders": [{
"type": "amazon-ebs",
diff --git a/tools/compute-images/arvados-images-azure.json b/tools/compute-images/arvados-images-azure.json
index a0278d515..ec1d9b6a6 100644
--- a/tools/compute-images/arvados-images-azure.json
+++ b/tools/compute-images/arvados-images-azure.json
@@ -1,22 +1,22 @@
{
"variables": {
- "resource_group": null,
+ "account_file": "",
+ "arvados_cluster": "",
+ "build_environment": "azure-arm",
"client_id": "{{env `ARM_CLIENT_ID`}}",
"client_secret": "{{env `ARM_CLIENT_SECRET`}}",
- "subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}",
- "tenant_id": "{{env `ARM_TENANT_ID`}}",
- "build_environment": "azure-arm",
"cloud_environment_name": "Public",
- "location": "centralus",
- "ssh_user": "packer",
- "ssh_private_key_file": "{{env `PACKERPRIVKEY`}}",
"image_sku": "",
- "arvados_cluster": "",
+ "location": "centralus",
"project_id": "",
- "account_file": "",
- "resolver": "",
+ "public_key_file": "",
"reposuffix": "",
- "public_key_file": ""
+ "resolver": "",
+ "resource_group": null,
+ "ssh_private_key_file": "{{env `PACKERPRIVKEY`}}",
+ "ssh_user": "packer",
+ "subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}",
+ "tenant_id": "{{env `ARM_TENANT_ID`}}"
},
"builders": [
{
commit ed6110546d621c8d3924aa813fba1209d47fb1be
Author: Javier Bértoli <jbertoli at curii.com>
Date: Wed Mar 3 08:57:03 2021 -0300
fix(compute-images): make resolver setting optional
Also, change docker's systemd service path to /etc instead of /lib
refs #17438
Arvados-DCO-1.1-Signed-off-by: Javier Bértoli <jbertoli at curii.com>
diff --git a/tools/compute-images/build.sh b/tools/compute-images/build.sh
index fb02ce944..36f0e18a3 100755
--- a/tools/compute-images/build.sh
+++ b/tools/compute-images/build.sh
@@ -49,7 +49,7 @@ Options:
Azure SKU image to use
--ssh_user (default: packer)
The user packer will use to log into the image
- --resolver (default: 8.8.8.8)
+ --resolver (default: host's network provided)
The dns resolver for the machine
--reposuffix (default: unset)
Set this to "-dev" to track the unstable/dev Arvados repositories
diff --git a/tools/compute-images/scripts/base.sh b/tools/compute-images/scripts/base.sh
index eeda57388..be67ffb56 100644
--- a/tools/compute-images/scripts/base.sh
+++ b/tools/compute-images/scripts/base.sh
@@ -78,8 +78,12 @@ $SUDO echo -e "{\n \"Quota\": \"10G\",\n \"RemoveStoppedContainers\": \"always
$SUDO sed -i 's/GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"/g' /etc/default/grub
$SUDO update-grub
-# Set a higher ulimit for docker
-$SUDO sed -i "s/ExecStart=\(.*\)/ExecStart=\1 --default-ulimit nofile=10000:10000 --dns ${RESOLVER}/g" /lib/systemd/system/docker.service
+# Set a higher ulimit and the resolver (if set) for docker
+if [ "x$RESOLVER" != "x" ]; then
+ SET_RESOLVER="--dns ${RESOLVER}"
+fi
+
+$SUDO sed "s/ExecStart=\(.*\)/ExecStart=\1 --default-ulimit nofile=10000:10000 ${SET_RESOLVER}/g" > /etc/systemd/system/docker.service
$SUDO systemctl daemon-reload
# Make sure user_allow_other is set in fuse.conf
@@ -97,10 +101,11 @@ $SUDO chown -R crunch:crunch /home/crunch/.ssh
$SUDO chmod 600 /home/crunch/.ssh/authorized_keys
$SUDO chmod 700 /home/crunch/.ssh/
-# Make sure we resolve via the provided resolver IP. Prepending is good enough because
+# Make sure we resolve via the provided resolver IP if set. Prepending is good enough because
# unless 'rotate' is set, the nameservers are queried in order (cf. man resolv.conf)
-$SUDO sed -i "s/#prepend domain-name-servers 127.0.0.1;/prepend domain-name-servers ${RESOLVER};/" /etc/dhcp/dhclient.conf
-
+if [ "x$RESOLVER" != "x" ]; then
+ $SUDO sed -i "s/#prepend domain-name-servers 127.0.0.1;/prepend domain-name-servers ${RESOLVER};/" /etc/dhcp/dhclient.conf
+fi
# Set up the cloud-init script that will ensure encrypted disks
$SUDO mv /tmp/usr-local-bin-ensure-encrypted-partitions.sh /usr/local/bin/ensure-encrypted-partitions.sh
$SUDO chmod 755 /usr/local/bin/ensure-encrypted-partitions.sh
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list