Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add ASSIGN_PUBLIC_IP configuration option #28

Merged
merged 2 commits into from
Oct 29, 2020

Conversation

colekettler
Copy link
Contributor

@colekettler colekettler commented Oct 28, 2020

Overview

Adds a configuration option for assignPublicIp in the awsvpcConfiguration block. Setting the ASSIGN_PUBLIC_IP config option to ENABLED will result in a public IP address automatically being assigned to the new task. This new setting defaults to DISABLED, which matches current behavior.

Closes #23

Notes

This should result in a minor version bump to the next release.

Testing Instructions

diff --git a/src/django/Dockerfile b/src/django/Dockerfile
index ffa07e5..c342cdb 100644
--- a/src/django/Dockerfile
+++ b/src/django/Dockerfile
@@ -7,6 +7,7 @@ COPY requirements.txt /usr/local/src/
 RUN set -ex \
     && buildDeps=" \
     build-essential \
+    git \
     " \
     && deps=" \
     postgresql-client-12 \
diff --git a/src/django/oar/settings.py b/src/django/oar/settings.py
index 6674642..6461b52 100644
--- a/src/django/oar/settings.py
+++ b/src/django/oar/settings.py
@@ -315,6 +315,7 @@ ECSMANAGE_ENVIRONMENTS = {
             'Environment': 'Staging',
             'Project': 'OpenApparelRegistry'
         },
+        'ASSIGN_PUBLIC_IP': 'ENABLED',
         'AWS_REGION': 'eu-west-1',
     },
     'production': {
diff --git a/src/django/requirements.txt b/src/django/requirements.txt
index dae1c40..f22e0db 100644
--- a/src/django/requirements.txt
+++ b/src/django/requirements.txt
@@ -4,7 +4,7 @@ coreapi==2.3.3
 dedupe==1.9.4
 defusedxml==0.6.0
 django-amazon-ses==2.1.1
-django-ecsmanage==2.0.0
+git+https://github.com/azavea/django-ecsmanage.git@feature/cek/assign-public-ip#egg=django-ecsmanage
 django-extensions==2.1.9
 django-jsonview==1.2.0
 django-rest-auth[with_social]==0.9.5
  • Get a shell in the development VM with vagrant ssh
  • Run ./scripts/update
  • Run ./scripts/manage ecsmanage migrate help
  • Before the newly provisioning / running task stops, confirm that a public IP address has been assigned:
    Screen Shot 2020-10-27 at 10 58 59 PM
  • Run git checkout HEAD -- ./src/django/oar/settings.py to revert the changes to that file and remove the ASSIGN_PUBLIC_IP setting.
  • Run ./scripts/update
  • Run ./scripts/manage ecsmanage migrate help
  • Before the newly provisioning / running task stops, confirm that no public IP address has been assigned:
    Screen Shot 2020-10-27 at 11 03 32 PM

@colekettler colekettler self-assigned this Oct 28, 2020
@colekettler colekettler changed the title Add config option for assignPublicIp Add ASSIGN_PUBLIC_IP configuration option Oct 28, 2020
@colekettler colekettler changed the title Add ASSIGN_PUBLIC_IP configuration option Add ASSIGN_PUBLIC_IP configuration option Oct 28, 2020
@colekettler colekettler marked this pull request as ready for review October 28, 2020 03:12
Copy link
Contributor

@hectcastro hectcastro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good and functionality is working as expected. 🚀

@colekettler colekettler merged commit a75fa2a into develop Oct 29, 2020
@colekettler colekettler deleted the feature/cek/assign-public-ip branch October 29, 2020 12:51
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to configure assignPublicIp of awsvpcConfiguration block
2 participants