-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdeploy-seqerakit.yml
More file actions
144 lines (118 loc) · 4.68 KB
/
deploy-seqerakit.yml
File metadata and controls
144 lines (118 loc) · 4.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# TODO We'll need to move this to the actual GitHub workflows directory, but this is just a placeholder anyways.
# We should merge our current setup and then make a PR updating it to the new setup that we want to have.
name: Deploy Seqerakit Infrastructure
on:
push:
branches: [main]
paths:
- "seqerakit/**"
pull_request:
branches: [main]
paths:
- "seqerakit/**"
jobs:
validate:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
defaults:
run:
working-directory: seqerakit
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup Seqerakit
uses: seqeralabs/setup-seqerakit@v1
with:
token: ${{ secrets.TOWER_ACCESS_TOKEN }}
- name: Load environment variables
run: |
# Install direnv for 1Password integration
sudo apt-get update && sudo apt-get install -y direnv
# Allow .envrc and load environment
direnv allow && eval "$(direnv export bash)"
- name: Validate CPU environment
run: seqerakit aws_ireland_fusionv2_nvme_cpu_current.yml --dryrun
- name: Validate CPU ARM environment
run: seqerakit aws_ireland_fusionv2_nvme_cpu_arm_current.yml --dryrun
- name: Validate GPU environment
run: seqerakit aws_ireland_fusionv2_nvme_gpu_current.yml --dryrun
- name: Comment PR with validation results
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
if: always()
with:
script: |
const output = `
## Seqerakit Validation Results 🧪
✅ All compute environment configurations have been validated successfully.
The following environments were tested:
- CPU Environment (aws_ireland_fusionv2_nvme_cpu)
- CPU ARM Environment (aws_ireland_fusionv2_nvme_cpu_ARM_snapshots)
- GPU Environment (aws_ireland_fusionv2_nvme_gpu_snapshots)
Ready for deployment! 🚀
`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
});
deploy:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
defaults:
run:
working-directory: seqerakit
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup Seqerakit
uses: seqeralabs/setup-seqerakit@v1
with:
token: ${{ secrets.TOWER_ACCESS_TOKEN }}
- name: Load environment variables
run: |
# Install direnv for 1Password integration
sudo apt-get update && sudo apt-get install -y direnv
# Allow .envrc and load environment
direnv allow && eval "$(direnv export bash)"
- name: Deploy CPU environment
run: seqerakit aws_ireland_fusionv2_nvme_cpu_current.yml
- name: Deploy CPU ARM environment
run: seqerakit aws_ireland_fusionv2_nvme_cpu_arm_current.yml
- name: Deploy GPU environment
run: seqerakit aws_ireland_fusionv2_nvme_gpu_current.yml
- name: Notify deployment success
if: success()
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
with:
script: |
const output = `
## Seqerakit Deployment Completed ✅
Successfully deployed all compute environments:
- ✅ CPU Environment (aws_ireland_fusionv2_nvme_cpu)
- ✅ CPU ARM Environment (aws_ireland_fusionv2_nvme_cpu_ARM_snapshots)
- ✅ GPU Environment (aws_ireland_fusionv2_nvme_gpu_snapshots)
Infrastructure is now up to date! 🎉
`;
github.rest.repos.createCommitComment({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: context.sha,
body: output
});
- name: Notify deployment failure
if: failure()
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
with:
script: |
const output = `
## Seqerakit Deployment Failed ❌
Deployment failed for commit ${context.sha}.
Please check the workflow logs for details and fix any issues.
`;
github.rest.repos.createCommitComment({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: context.sha,
body: output
});