From 7ca7bcc952afe933879505f92ec2ef3e6caa0e41 Mon Sep 17 00:00:00 2001 From: Zach Date: Tue, 20 Jun 2023 10:09:30 -0400 Subject: [PATCH] Cloud init scripts for user/dev mode (#430) * cloud init install * add dev mode script + description * instructions --- scripts/cloud-init-dev-mode-install.yaml | 44 +++++++++++++++++++++++ scripts/cloud-init-user-mode-install.yaml | 35 ++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 scripts/cloud-init-dev-mode-install.yaml create mode 100644 scripts/cloud-init-user-mode-install.yaml diff --git a/scripts/cloud-init-dev-mode-install.yaml b/scripts/cloud-init-dev-mode-install.yaml new file mode 100644 index 00000000..965afe3a --- /dev/null +++ b/scripts/cloud-init-dev-mode-install.yaml @@ -0,0 +1,44 @@ +#cloud-config + +# Used for easily testing stacks-in-development on cloud platforms +# Assumes Ubuntu, edit the last line if targeting a different OS + +# Once SSH'd into the server, run: +# `$ cd stack-orchestrator` +# `$ git checkout +# `$ ./scripts/developer-mode-setup.sh` +# `$ source ./venv/bin/activate` + +# Followed by the stack instructions. + +package_update: true +package_upgrade: true + +groups: + - docker + +system_info: + default_user: + groups: [ docker ] + +packages: + - apt-transport-https + - ca-certificates + - curl + - jq + - git + - gnupg + - lsb-release + - unattended-upgrades + - python3.10-venv + - pip + +runcmd: + - mkdir -p /etc/apt/keyrings + - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg + - echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null + - apt-get update + - apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin + - systemctl enable docker + - systemctl start docker + - git clone https://github.com/cerc-io/stack-orchestrator.git /home/ubuntu/stack-orchestrator diff --git a/scripts/cloud-init-user-mode-install.yaml b/scripts/cloud-init-user-mode-install.yaml new file mode 100644 index 00000000..bd02416c --- /dev/null +++ b/scripts/cloud-init-user-mode-install.yaml @@ -0,0 +1,35 @@ +#cloud-config + +# Used for installing Stack Orchestrator on platforms that support `cloud-init` +# Tested on Ubuntu + +package_update: true +package_upgrade: true + +groups: + - docker + +system_info: + default_user: + groups: [ docker ] + +packages: + - apt-transport-https + - ca-certificates + - curl + - jq + - git + - gnupg + - lsb-release + - unattended-upgrades + +runcmd: + - mkdir -p /etc/apt/keyrings + - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg + - echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null + - apt-get update + - apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin + - systemctl enable docker + - systemctl start docker + - curl -L -o /usr/local/bin/laconic-so https://github.com/cerc-io/stack-orchestrator/releases/latest/download/laconic-so + - chmod +x /usr/local/bin/laconic-so