Skip to content

Commit

Permalink
fix(deploy): Fix base image used in deploy tests (#27) (#31)
Browse files Browse the repository at this point in the history
The tests to deploy a server group to GCE take a base image, then
use a startup script to install apache using apt. At some point
recently, the command to install apache started pausing for user
input (despite passing the -y flag to apt-get install), meaning
that the startup script would hang forever, and the health check
waiting for the instance to respond on port 80 would also hang
forever. This was making tests of deploying to GCE fail.

In general, a pre-baked image should have all of the dependencies
already installed. I've made a new image called apache-base-image,
which is just Debian 10 with apache2 already installed and configured.
Let's use this image in the tests instead of installing apache as a
startup script, which is both less hermetic and less similar to the
common use case we'd like to support.

This PR updates the image name and removes the startup script.

Co-authored-by: Eric Zimanyi <ezimanyi@google.com>
  • Loading branch information
ezimanyi authored Mar 4, 2020
1 parent 9545b73 commit 965f452
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def add_commandline_parameters(cls, scenario_class, builder, defaults):
builder.add_argument(
'--test_gce_image_name',
default=defaults.get('TEST_GCE_IMAGE_NAME',
'citest-boot-image'),
'apache-base-image'),
help='Default Google Compute Engine image name to use when'
' creating test instances.')

Expand Down
2 changes: 0 additions & 2 deletions testing/citest/tests/bake_and_deploy_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,6 @@ def make_deploy_google_stage(self, requisiteStages=None):
'zone': self.bindings['TEST_GCE_ZONE'],
'network': 'default',
'instanceMetadata': {
'startup-script':
'sudo apt-get update && sudo apt-get install apache2 -y',
'load-balancer-names': self.__full_lb_name
},
'tags': [],
Expand Down
2 changes: 0 additions & 2 deletions testing/citest/tests/google_http_lb_upsert_scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,8 +634,6 @@ def add_server_group(self):
bindings['TEST_GCE_REGION']: [bindings['TEST_GCE_ZONE']]
},
'instanceMetadata': {
'startup-script': ('sudo apt-get update'
' && sudo apt-get install apache2 -y'),
'global-load-balancer-names': self.__lb_name,
'backend-service-names': 'bs-' + self.TEST_APP,
'load-balancing-policy': json.dumps(policy)
Expand Down
2 changes: 0 additions & 2 deletions testing/citest/tests/google_smoke_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,6 @@ def create_server_group(self):
bindings['TEST_GCE_REGION']: [bindings['TEST_GCE_ZONE']]
},
'instanceMetadata': {
'startup-script': ('sudo apt-get update'
' && sudo apt-get install apache2 -y'),
'load-balancer-names': self.__lb_name
},
'account': bindings['SPINNAKER_GOOGLE_ACCOUNT'],
Expand Down

0 comments on commit 965f452

Please sign in to comment.