-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds a Dockerfile for hortacloud deployment (#13)
* feat: adds a Dockerfile for hortacloud deployment * modifes Dockerfile and README instructions * modifes README instructions * adds github actions workflow for publishing docker image
- Loading branch information
Showing
6 changed files
with
149 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Desktop (please complete the following information):** | ||
- OS: [e.g. iOS] | ||
- Browser [e.g. chrome, safari] | ||
- Version [e.g. 22] | ||
|
||
**Smartphone (please complete the following information):** | ||
- Device: [e.g. iPhone6] | ||
- OS: [e.g. iOS8.1] | ||
- Browser [e.g. stock browser, safari] | ||
- Version [e.g. 22] | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
name: User story | ||
about: This template provides a basic structure for user story issues. | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
# User story | ||
As a ..., I want to ..., so I can ... | ||
|
||
*Ideally, this is in the issue title, but if not, you can put it here. If so, delete this section.* | ||
|
||
# Acceptance criteria | ||
- [ ] This is something that can be verified to show that this user story is satisfied. | ||
|
||
# Sprint Ready Checklist | ||
- [ ] 1. Acceptance criteria defined | ||
- [ ] 2. Team understands acceptance criteria | ||
- [ ] 3. Team has defined solution / steps to satisfy acceptance criteria | ||
- [ ] 4. Acceptance criteria is verifiable / testable | ||
- [ ] 5. External / 3rd Party dependencies identified | ||
- [ ] 6. Ticket is prioritized and sized | ||
|
||
# Notes | ||
*Add any helpful notes here.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Tag and publish | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- hortacloud-deployment/** | ||
jobs: | ||
tag: | ||
uses: AllenNeuralDynamics/aind-github-actions/.github/workflows/tag.yml@main | ||
secrets: | ||
SERVICE_TOKEN: ${{ secrets.SERVICE_TOKEN }} | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
needs: tag | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Pull latest changes | ||
run: git pull origin main | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Login to Github Packages | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build image and push to GitHub Container Registry | ||
uses: docker/build-push-action@v3 | ||
with: | ||
# relative path to the place where source code with Dockerfile is located | ||
context: ./horta-deployment | ||
push: true | ||
tags: | | ||
ghcr.io/allenneuraldynamics/hortacloud-deployment:${{ needs.tag.outputs.new_version }} | ||
ghcr.io/allenneuraldynamics/hortacloud-deployment:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from node:16 | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y less | ||
|
||
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \ | ||
unzip awscliv2.zip && \ | ||
./aws/install && \ | ||
rm awscliv2.zip | ||
|
||
RUN npm install -g aws-cdk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# hortacloud-deployment | ||
|
||
Dockerfile to build an image for deployment of hortacloud | ||
|
||
## Usage | ||
Refer to hortacloud [deployment instructions](https://hortacloud.janelia.org/docs/administration/aws/deployment/) for detailed steps | ||
### Container setup | ||
- Run `docker pull ghcr.io/allenneuraldynamics/hortacloud-deployment:latest hortacloud` to pull the docker image. | ||
- Run `docker run -it hortacloud bash` to run a container interactively. | ||
### Horta deployment | ||
- From your local machine, generate temporary aws credentials by running `aws sts -get-session-token`. Note the **AWS_ACCESS_KEY_ID**, **AWS_SECRET_ACCESS_KEY** and **AWS_SESSION_TOKEN** values from the output. | ||
- Set up AWS credentials environment variables using the values from the the previous step. | ||
- Run `git clone **https://github.com/JaneliaSciComp/hortacloud/**. | ||
- In the cloned **hortacloud** folder, create/copy the **.env** file that contains all the required environment variables. If the **.env** variable is stored in a bucket, you can run `aws s3 cp s3://BUCKET_NAME/.env .env` to download it. | ||
- Follow the hortacloud deployment instructions for the remaining steps. |