Skip to content

Commit a4a1e88

Browse files
authored
Merge pull request #252 from awslabs/release/v4.0.0
Release v4.0.0 into Main
2 parents 82b8b94 + e51e0da commit a4a1e88

File tree

128 files changed

+21255
-14942
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+21255
-14942
lines changed

.github/workflows/code.deploy.demo.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
node-version: 20.x
4343
- name: Install CDK dependencies
4444
run: |
45-
npm install
45+
npm ci
4646
- name: Deploy LISA
4747
run: |
4848
make deploy HEADLESS=true

.github/workflows/code.deploy.dev.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
node-version: 20.x
4343
- name: Install CDK dependencies
4444
run: |
45-
npm install
45+
npm ci
4646
- name: Deploy LISA
4747
run: |
4848
make deploy HEADLESS=true

.github/workflows/code.publish.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish LISA NPM Package
2+
on:
3+
release:
4+
types: [released]
5+
6+
permissions:
7+
contents: read
8+
packages: write
9+
10+
jobs:
11+
PublishLISA:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
packages: write
16+
steps:
17+
- uses: actions/checkout@v4
18+
# Setup .npmrc file to publish to GitHub Packages
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: '20.x'
22+
registry-url: 'https://npm.pkg.github.com'
23+
- run: npm ci
24+
- run: npm publish
25+
env:
26+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
28+
SendSlackNotification:
29+
name: Send Slack Notification
30+
needs: [ PublishLISA ]
31+
runs-on: ubuntu-latest
32+
if: always()
33+
steps:
34+
- name: Send Notification that package has published
35+
uses: rtCamp/action-slack-notify@v2
36+
env:
37+
SLACK_WEBHOOK: ${{ secrets.INTERNAL_DEV_SLACK_WEBHOOK_URL }}
38+
SLACK_COLOR: ${{ contains(join(needs.*.result, ' '), 'failure') && 'failure' || 'success' }}
39+
SLACK_TITLE: 'NPM Package Published'
40+
SLACK_FOOTER: ''
41+
MSG_MINIMAL: 'actions url,commit'
42+
SLACK_MESSAGE_ON_FAILURE: '<!here> NPM Package publish FAILED for version ${{ github.event.pull_request.head.ref }}|commit>'
43+
SLACK_MESSAGE_ON_SUCCESS: 'NPM Package published SUCCESS for ${{ github.event.pull_request.head.ref }}|commit>.'
44+
SLACK_MESSAGE: 'NPM Publish Finished with status ${{ job.status }} for <${{ github.event.pull_request.head.ref }}|commit>'

.github/workflows/docs.deploy.github-pages.yml

+3-8
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,10 @@ jobs:
3131
uses: actions/configure-pages@v4
3232
- name: Install root dependencies
3333
run: |
34-
npm install
35-
- name: Install dependencies
36-
working-directory: ./lib/docs
37-
run: npm install
38-
env:
39-
CI: ""
34+
npm ci
4035
- name: Build with VitePress
41-
working-directory: ./lib/docs
42-
run: npm run build
36+
working-directory: ./
37+
run: npm run build -w lib/docs
4338
env:
4439
CI: ""
4540
DOCS_BASE_PATH: '/LISA/'

.github/workflows/test-and-lint.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
node-version: 20.x
3636
- name: Install dependencies
3737
run: |
38-
npm install
38+
npm ci
3939
- name: Run tests
4040
run: |
4141
npm run test
@@ -53,14 +53,10 @@ jobs:
5353
uses: actions/setup-node@v3
5454
with:
5555
node-version: 20.x
56-
- name: Install Chatbot dependencies
57-
working-directory: ./lib/user-interface/react
58-
run: |
59-
npm install
6056
- name: Install CDK dependencies
6157
working-directory: ./
6258
run: |
63-
npm install
59+
npm ci
6460
- uses: pre-commit/[email protected]
6561
send_final_slack_notification:
6662
name: Send Final Slack Notification

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.5.1
1+
4.0.0

bin/lisa.ts

+39-7
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import _ from 'lodash';
2626

2727
import { Config, ConfigFile, ConfigSchema } from '../lib/schema';
2828
import { LisaServeApplicationStage } from '../lib/stages';
29+
import { SSMClient, GetParameterCommand, SSMServiceException } from '@aws-sdk/client-ssm';
2930

3031
// Read configuration files
3132
const baseConfigFilePath = path.join(__dirname, '../config-base.yaml');
@@ -71,12 +72,43 @@ const env: cdk.Environment = {
7172
region: config.region,
7273
};
7374

74-
// Application
75-
const app = new cdk.App();
75+
function getExistingRagRepositories () {
76+
const registeredRepositoriesParamName = `${config.deploymentPrefix}/registeredRepositories`;
77+
const client = new SSMClient({ region: config.region });
78+
const command = new GetParameterCommand({ Name: registeredRepositoriesParamName });
7679

77-
new LisaServeApplicationStage(app, config.deploymentStage, {
78-
env: env,
79-
config: config,
80-
});
80+
return client.send(command)
81+
.then((response) => {
82+
console.log('SSM Parameter Value:', response.Parameter?.Value);
83+
return response.Parameter?.Value ? JSON.parse(response.Parameter.Value!) : [];
84+
})
85+
.catch((error: SSMServiceException) => {
86+
// Handle parameter not found separately
87+
if (error.name === 'ParameterNotFound') {
88+
console.error(`Parameter '${registeredRepositoriesParamName}' not found.`);
89+
return [];
90+
}
91+
92+
// Handle other errors
93+
console.error('Error fetching SSM parameter:', error);
94+
throw error;
95+
});
96+
}
97+
98+
(async () => {
99+
// Lookup and pass any previously deployed RAG configurations as an environment variable
100+
// so we can disallow new entries via YAML configuration.
101+
const ragRepositories = await getExistingRagRepositories();
102+
process.env.RAG_REPOSITORIES = JSON.stringify(ragRepositories || []);
103+
104+
// Application
105+
const app = new cdk.App();
106+
107+
new LisaServeApplicationStage(app, config.deploymentStage, {
108+
env: env,
109+
config: config,
110+
});
111+
112+
app.synth();
81113

82-
app.synth();
114+
})();

0 commit comments

Comments
 (0)