Skip to content

Commit 81f750f

Browse files
authored
Support build image in private networks by retrieving dependencies from s3 bucket (aws#6296)
1 parent 4006d0b commit 81f750f

File tree

4 files changed

+33
-12
lines changed

4 files changed

+33
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ CHANGELOG
1919

2020
**CHANGES**
2121
- Upgrade Cinc Client to version to 18.4.12 from 18.2.7.
22+
- Allow build-image to be run in an isolated network.
2223

2324
3.9.3
2425
------

cli/src/pcluster/constants.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -294,16 +294,7 @@ class Operation(Enum):
294294
VERSION = "version"
295295

296296

297-
UNSUPPORTED_OPERATIONS_MAP = {
298-
Operation.BUILD_IMAGE: ["us-iso"],
299-
Operation.DELETE_IMAGE: ["us-iso"],
300-
Operation.DESCRIBE_IMAGE: ["us-iso"],
301-
Operation.LIST_IMAGES: ["us-iso"],
302-
Operation.EXPORT_IMAGE_LOGS: ["us-iso"],
303-
Operation.GET_IMAGE_LOG_EVENTS: ["us-iso"],
304-
Operation.GET_IMAGE_STACK_EVENTS: ["us-iso"],
305-
Operation.LIST_IMAGE_LOG_STREAMS: ["us-iso"],
306-
}
297+
UNSUPPORTED_OPERATIONS_MAP = {}
307298

308299
MAX_TAGS_COUNT = 40 # Tags are limited to 50, reserve some tags for parallelcluster specified tags
309300

cli/src/pcluster/resources/imagebuilder/parallelcluster.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,16 @@ phases:
222222
curl --retry 3 -L {{ build.CincUrl.outputs.stdout }} | bash -s -- -v {{ ChefVersion }}
223223
224224
if [[ -e ${!CA_CERTS_FILE} ]]; then
225+
mkdir -p /opt/cinc/embedded/ssl/certs
225226
ln -sf ${!CA_CERTS_FILE} /opt/cinc/embedded/ssl/certs/cacert.pem
226227
fi
228+
229+
curl --retry 3 -L -o gems.tgz https://${AWS::Region}-aws-parallelcluster.s3.${AWS::Region}.amazonaws.com/archives/dependencies/ruby/gems.tgz
230+
tar -xf gems.tgz
231+
232+
cd vendor/cache
227233
228-
/opt/cinc/embedded/bin/gem install --no-document berkshelf:{{ BerkshelfVersion }}
234+
/opt/cinc/embedded/bin/gem install --local --no-document berkshelf:{{ BerkshelfVersion }}
229235
230236
# Download and vendor Cookbook
231237
- name: DownloadCookbook
@@ -235,9 +241,10 @@ phases:
235241
- |
236242
set -v
237243
mkdir -p /etc/chef && sudo chown -R root:root /etc/chef
244+
238245
curl --retry 3 -L -o /etc/chef/aws-parallelcluster-cookbook.tgz "{{ build.CookbookUrl.outputs.stdout }}"
239246
240-
mkdir /tmp/cookbooks
247+
mkdir -p /tmp/cookbooks
241248
cd /tmp/cookbooks
242249
tar -xzf /etc/chef/aws-parallelcluster-cookbook.tgz
243250
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{%- import 'common.jinja2' as common with context -%}
2+
{% if REGIONS %}
3+
{%- set REGIONS = [ REGIONS ] -%}
4+
{% else %}
5+
{%- set REGIONS = ["us-isob-east-1","us-iso-east-1"] -%}
6+
{% endif %}
7+
{%- set INSTANCES = ["c5.xlarge"] -%}
8+
{% if OSS %}
9+
{%- set OSS = [ OSS ] -%}
10+
{% else %}
11+
{%- set OSS = ["alinux2"] -%}
12+
{% endif %}
13+
{%- set SCHEDULERS = ["slurm"] -%}
14+
---
15+
test-suites:
16+
createami:
17+
test_createami.py::test_build_image:
18+
dimensions:
19+
- regions: {{ REGIONS }}
20+
instances: {{ INSTANCES }}
21+
schedulers: {{ SCHEDULERS }}
22+
oss: {{ OSS }}

0 commit comments

Comments
 (0)