Skip to content

Commit

Permalink
Merge pull request #597 from ibi-group/deploy-r7a
Browse files Browse the repository at this point in the history
Support R7A Deployment
  • Loading branch information
miles-grant-ibigroup authored May 22, 2024
2 parents 18dbbc3 + e9753de commit 8eda625
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.amazonaws.services.ec2.model.Filter;
import com.amazonaws.services.ec2.model.IamInstanceProfileSpecification;
import com.amazonaws.services.ec2.model.Instance;
import com.amazonaws.services.ec2.model.InstanceMetadataOptionsRequest;
import com.amazonaws.services.ec2.model.InstanceNetworkInterfaceSpecification;
import com.amazonaws.services.ec2.model.InstanceStateChange;
import com.amazonaws.services.ec2.model.InstanceType;
Expand Down Expand Up @@ -1009,6 +1010,7 @@ private List<Instance> startEC2Instances(int count, boolean graphAlreadyBuilt) {
.withKeyName(otpServer.ec2Info.keyName)
// This will have the instance terminate when it is shut down.
.withInstanceInitiatedShutdownBehavior("terminate")
.withMetadataOptions(new InstanceMetadataOptionsRequest().withHttpTokens("optional").withHttpEndpoint("enabled"))
.withUserData(Base64.encodeBase64String(userData.getBytes()));
List<Instance> instances;
try {
Expand Down Expand Up @@ -1383,6 +1385,7 @@ public String constructUserData(boolean graphAlreadyBuilt) {

List<String> lines = new ArrayList<>();
lines.add("#!/bin/bash");
lines.add("mkdir /opt/otp/");
// NOTE: user data output is logged to `/var/log/cloud-init-output.log` automatically with ec2 instances
// Add some items to the $PATH as the $PATH with user-data scripts differs from the ssh $PATH.
lines.add("export PATH=\"$PATH:/home/ubuntu/.yarn/bin\"");
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"#!/bin/bash\nexport PATH=\"$PATH:/home/ubuntu/.yarn/bin\"\nexport PATH=\"$PATH:/home/ubuntu/.nvm/versions/node/v12.16.3/bin\"\nrm /usr/share/nginx/client/status.json || echo '' > /dev/null\nrm /var/otp/otp-runner-manifest.json || echo '' > /dev/null\nrm /opt/otp/otp-latest-trimet-dev || echo '' > /dev/null\nrm /var/log/otp-runner.log || echo '' > /dev/null\nrm /var/log/otp-build.log || echo '' > /dev/null\nrm /var/log/otp-server.log || echo '' > /dev/null\naws s3 cp s3://datatools-dev/test-deploy/otp-runner-graph-build-manifest.json /var/otp/otp-runner-manifest.json\nyarn global add https://github.com/ibi-group/otp-runner.git#master\notp-runner /var/otp/otp-runner-manifest.json"
"#!/bin/bash\nmkdir /opt/otp/\nexport PATH=\"$PATH:/home/ubuntu/.yarn/bin\"\nexport PATH=\"$PATH:/home/ubuntu/.nvm/versions/node/v12.16.3/bin\"\nrm /usr/share/nginx/client/status.json || echo '' > /dev/null\nrm /var/otp/otp-runner-manifest.json || echo '' > /dev/null\nrm /opt/otp/otp-latest-trimet-dev || echo '' > /dev/null\nrm /var/log/otp-runner.log || echo '' > /dev/null\nrm /var/log/otp-build.log || echo '' > /dev/null\nrm /var/log/otp-server.log || echo '' > /dev/null\naws s3 cp s3://datatools-dev/test-deploy/otp-runner-graph-build-manifest.json /var/otp/otp-runner-manifest.json\nyarn global add https://github.com/ibi-group/otp-runner.git#master\notp-runner /var/otp/otp-runner-manifest.json"
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"#!/bin/bash\nexport PATH=\"$PATH:/home/ubuntu/.yarn/bin\"\nexport PATH=\"$PATH:/home/ubuntu/.nvm/versions/node/v12.16.3/bin\"\nrm /usr/share/nginx/client/status.json || echo '' > /dev/null\nrm /var/otp/otp-runner-manifest.json || echo '' > /dev/null\nrm /opt/otp/otp-latest-trimet-dev || echo '' > /dev/null\nrm /var/log/otp-runner.log || echo '' > /dev/null\nrm /var/log/otp-build.log || echo '' > /dev/null\nrm /var/log/otp-server.log || echo '' > /dev/null\naws s3 cp s3://datatools-dev/test-deploy/otp-runner-graph-build-manifest.json /var/otp/otp-runner-manifest.json\nyarn global add https://github.com/ibi-group/otp-runner.git#master\notp-runner /var/otp/otp-runner-manifest.json"
"#!/bin/bash\nmkdir /opt/otp/\nexport PATH=\"$PATH:/home/ubuntu/.yarn/bin\"\nexport PATH=\"$PATH:/home/ubuntu/.nvm/versions/node/v12.16.3/bin\"\nrm /usr/share/nginx/client/status.json || echo '' > /dev/null\nrm /var/otp/otp-runner-manifest.json || echo '' > /dev/null\nrm /opt/otp/otp-latest-trimet-dev || echo '' > /dev/null\nrm /var/log/otp-runner.log || echo '' > /dev/null\nrm /var/log/otp-build.log || echo '' > /dev/null\nrm /var/log/otp-server.log || echo '' > /dev/null\naws s3 cp s3://datatools-dev/test-deploy/otp-runner-graph-build-manifest.json /var/otp/otp-runner-manifest.json\nyarn global add https://github.com/ibi-group/otp-runner.git#master\notp-runner /var/otp/otp-runner-manifest.json"
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"#!/bin/bash\nexport PATH=\"$PATH:/home/ubuntu/.yarn/bin\"\nexport PATH=\"$PATH:/home/ubuntu/.nvm/versions/node/v12.16.3/bin\"\nrm /usr/share/nginx/client/status.json || echo '' > /dev/null\nrm /var/otp/otp-runner-manifest.json || echo '' > /dev/null\nrm /opt/otp/otp-latest-trimet-dev || echo '' > /dev/null\nrm /var/log/otp-runner.log || echo '' > /dev/null\nrm /var/log/otp-build.log || echo '' > /dev/null\nrm /var/log/otp-server.log || echo '' > /dev/null\naws s3 cp s3://datatools-dev/test-deploy/otp-runner-server-only-manifest.json /var/otp/otp-runner-manifest.json\nyarn global add https://github.com/ibi-group/otp-runner.git#master\notp-runner /var/otp/otp-runner-manifest.json"
"#!/bin/bash\nmkdir /opt/otp/\nexport PATH=\"$PATH:/home/ubuntu/.yarn/bin\"\nexport PATH=\"$PATH:/home/ubuntu/.nvm/versions/node/v12.16.3/bin\"\nrm /usr/share/nginx/client/status.json || echo '' > /dev/null\nrm /var/otp/otp-runner-manifest.json || echo '' > /dev/null\nrm /opt/otp/otp-latest-trimet-dev || echo '' > /dev/null\nrm /var/log/otp-runner.log || echo '' > /dev/null\nrm /var/log/otp-build.log || echo '' > /dev/null\nrm /var/log/otp-server.log || echo '' > /dev/null\naws s3 cp s3://datatools-dev/test-deploy/otp-runner-server-only-manifest.json /var/otp/otp-runner-manifest.json\nyarn global add https://github.com/ibi-group/otp-runner.git#master\notp-runner /var/otp/otp-runner-manifest.json"

0 comments on commit 8eda625

Please sign in to comment.