forked from THUDM/CogVLM
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
46 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,46 @@ | ||
# Autogenerated via deploy.py, do not edit! | ||
|
||
name: Docker Build on EC2 Instance | ||
|
||
on: | ||
push: | ||
branches: | ||
- feat/docker | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: SSH and Execute Build on EC2 | ||
uses: appleboy/ssh-action@master | ||
with: | ||
command_timeout: "60m" | ||
host: 44.222.213.196 | ||
username: ubuntu # Usually 'ubuntu' or 'ec2-user' | ||
|
||
key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
|
||
script: | | ||
source activate pytorch | ||
nvidia-smi | ||
rm -rf CogVLM || true | ||
git clone https://github.com/OpenAdaptAI/CogVLM | ||
cd CogVLM | ||
git checkout feat/docker | ||
git pull | ||
# Stop and remove existing container if it's running | ||
sudo docker stop cogvlm-container || true | ||
sudo docker rm cogvlm-container || true | ||
# Build the image | ||
sudo nvidia-docker build -t cogvlm . || exit 1 | ||
# Run the image | ||
sudo docker run -d -p 6092:6092 --gpus all --name cogvlm-container \ | ||
-e OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} \ | ||
cogvlm |