Skip to content

Commit dd93c74

Browse files
nvidiaclaude
authored andcommitted
Update deploy workflow to use ain-js deployment SDK
Replace inline Docker deployment with ain.deployment.authorize() and ain.deployment.deploy() SDK calls for secure CI/CD container deployment. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5e7274a commit dd93c74

1 file changed

Lines changed: 20 additions & 11 deletions

File tree

.github/workflows/deploy-cogito.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,31 @@ jobs:
3737
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
3838
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
3939
40-
- name: Register deployment on AIN
40+
- name: Deploy to AIN node
4141
run: |
4242
cd cogito && npm ci
4343
node -e "
4444
const Ain = require('@ainblockchain/ain-js');
4545
const ain = new Ain('${{ secrets.AIN_PROVIDER_URL }}');
4646
ain.wallet.addAndSetDefaultAccount('${{ secrets.AIN_PRIVATE_KEY }}');
47-
const addr = ain.wallet.defaultAccount.address;
48-
ain.db.ref('/apps/knowledge/deployments/' + addr + '/cogito').setValue({
49-
value: {
50-
image: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}',
51-
deployed_at: Date.now(),
52-
github_sha: '${{ github.sha }}',
53-
github_actor: '${{ github.actor }}',
47+
48+
// Authorize this GitHub user's GHCR namespace
49+
ain.deployment.authorize('${{ github.repository_owner }}')
50+
.then(r => console.log('Authorized:', JSON.stringify(r)))
51+
.catch(e => console.log('Auth skipped:', e.message));
52+
53+
// Deploy the container
54+
ain.deployment.deploy({
55+
image: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}',
56+
name: 'cogito',
57+
envVars: {
58+
AIN_PROVIDER_URL: 'http://ain-blockchain:8080',
59+
AIN_PRIVATE_KEY: '${{ secrets.AIN_PRIVATE_KEY }}',
60+
VLLM_URL: 'http://vllm:8000',
61+
VLLM_MODEL: 'Qwen/Qwen3-32B-AWQ',
62+
X402_PORT: '3402',
5463
},
55-
nonce: -1,
56-
}).then(r => console.log('Registered:', JSON.stringify(r?.result)))
57-
.catch(e => console.log('Registration skipped:', e.message));
64+
ports: { '3402': '3402' },
65+
}).then(r => console.log('Deployed:', JSON.stringify(r)))
66+
.catch(e => console.error('Deploy failed:', e.message));
5867
"

0 commit comments

Comments
 (0)