Skip to content

Commit

Permalink
use prefix to deploy multiple stack (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
maekawataiki authored Jan 22, 2024
1 parent 9cc2ab7 commit 11363d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion packages/cdk/bin/generative-ai-use-cases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ import { GenerativeAiUseCasesStack } from '../lib/generative-ai-use-cases-stack'

const app = new cdk.App();

new GenerativeAiUseCasesStack(app, 'GenerativeAiUseCasesStack');
const stage = app.node.tryGetContext('stage');

new GenerativeAiUseCasesStack(app, `${stage}GenerativeAiUseCasesStack`);
11 changes: 8 additions & 3 deletions packages/cdk/lib/construct/llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@ export class LLM extends Construct {
public readonly models: Model[] = models;
public readonly deploy_suffix: string =
'-' + new Date().toISOString().replace(/[:T-]/g, '').split('.')[0];
public readonly endpointConfigName =
'llm-jp-endpoint-config' + this.deploy_suffix;
public readonly endpointName = 'llm-jp-endpoint';
public readonly endpointConfigName;
public readonly endpointName;

constructor(scope: Construct, id: string) {
super(scope, id);

// Specify Endpoint with stage suffix
const stage = this.node.tryGetContext('stage');
const prefix = stage ? `${stage}-` : '';
this.endpointConfigName = prefix + 'llm-jp-endpoint-config' + this.deploy_suffix;
this.endpointName = prefix + 'llm-jp-endpoint';

// Get Container Image
// https://github.com/aws/deep-learning-containers/blob/master/available_images.md
const repositoryName = 'djl-inference';
Expand Down

0 comments on commit 11363d1

Please sign in to comment.