Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update docker-compose version of AWS instance #2421

Merged
merged 3 commits into from
Jul 30, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions engineering_tools/xil-cloud-formation-v0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ Parameters:
Description: The specific carma config which launches xil and platform to make available in the instance
Type: String
Default: "usdotfhwastoldev/carma-config:xil-cloud-test"
DockerComposeVersion:
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this doesn't need to be argument for the yaml. Local scope on line 429-430 should be enough

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah weird syntax error was giving me trouble so I was trying out different approaches. I learned in this aws yaml context that:

  • ${VARIABLE} is a parameter defined in the yaml level
  • $VARIABLE is a variable for the shell.
    Although I did defined the VARIABLE=docker-compose-version, it kept giving me error when I used it as ${VARIABLE} saying it was not resolved.

Description: Docker Compose version to install in the instance
Type: String
Default: "v2.27.1"
Mappings:
AMIMap:
us-east-1:
Expand Down Expand Up @@ -421,13 +425,15 @@ Resources:
# Install docker compose
DESTINATION=/usr/bin/docker-compose
sudo rm $DESTINATION
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.1/docker-compose-$(uname -s)-$(uname -m)" -o $DESTINATION
# Get most recent version using curl + grep
DockerComposeVersion=$(curl --silent https://api.github.com/repos/docker/compose/releases/latest | grep -Po '"tag_name": "\K.*\d')"
sudo curl -L "https://github.com/docker/compose/releases/download/${DockerComposeVersion}/docker-compose-$(uname -s)-$(uname -m)" -o $DESTINATION
sudo chmod 755 $DESTINATION

# Install carma-config
carma config install ${CarmaConfigImage}
carma config set ${CarmaConfigImage}

## Add VCS Sources
sudo apt-get update
sudo apt-get install -y lsb-release
Expand All @@ -450,7 +456,7 @@ Resources:

## Add VCS auto completion
echo "source /usr/share/vcstool-completion/vcs.bash" >> ~/.bashrc

# Clone Repos
cd /home/ubuntu/carma_ws
curl -L https://raw.githubusercontent.com/usdot-fhwa-stol/carma-platform/develop/carma-platform.repos | sed 's/git@github.com:/https:\/\/github.com\//' | vcs import
Expand Down Expand Up @@ -585,4 +591,4 @@ Resources:
Outputs:
EC2Host:
Description: EC2 Instance Created.
Value: !Ref DevMachine
Value: !Ref DevMachine
Loading