Skip to content

Commit

Permalink
run from clone
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorgoolsby committed Mar 26, 2024
1 parent 38d1b2d commit 6bb0866
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ artifact
cdk.out
.next
_next
index.faiss
Binary file removed index.faiss
Binary file not shown.
3 changes: 2 additions & 1 deletion src/backend/src/agent/LongTermAnnotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ When producing annotations, ensure they are tailored to capture the essence of e
if (fs.existsSync(INDEX_PATH)) {
index = Index.read(INDEX_PATH)
} else {
throw new Error('Index not found')
return { distances: [], labels: [] }
// throw new Error('Index not found')
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/backend/src/rest/AwsRest.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import { createHash, createHmac } from 'crypto'
import util_utf8_1 from '@aws-sdk/util-utf8'
import util_hex_encoding_1 from '@aws-sdk/util-hex-encoding'

const client = new S3Client(Config.awsConfig)
// const client = new S3Client(Config.awsConfig)
const client = null

export default class AwsRest {
static async getSignedCreateMultipartUploadUrl(
Expand Down Expand Up @@ -205,6 +206,7 @@ ${hexHashCanonical}`

async function send(command: any): Promise<any> {
console.debug(`Sending AWS Command ${command.constructor.name}`)
// $FlowFixMe
const res = await client.send(command)
return res
}
31 changes: 23 additions & 8 deletions src/common/src/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { loadEnv } from './loadEnv.js'
const env = loadEnv()
import nonMaybe from 'non-maybe'
import credentials from './loadAwsCredentials.js'
// import credentials from './loadAwsCredentials.js'
import { raw } from '../sql-template-tag.js'
import fs from 'fs'
import path from 'path'
Expand Down Expand Up @@ -61,13 +61,14 @@ console.log('isLocal', isLocal)
console.log('isStaging', isStaging)
console.log('isProd', isProd)

if (isLocal && !credentials.accessKeyId) {
throw new Error(
'When running locally, you should have aws_access_key_id defined in your ~/.aws/credentials file.',
)
}
// if (isLocal && !credentials.accessKeyId) {
// throw new Error(
// 'When running locally, you should have aws_access_key_id defined in your ~/.aws/credentials file.',
// )
// }

const stage = !STAGE ? hash(credentials.accessKeyId) : nonMaybe(STAGE)
// const stage = !STAGE ? hash(credentials.accessKeyId) : nonMaybe(STAGE)
const stage = 'test'
const dbPrefix = nonMaybe(DB_PREFIX)

console.log('stage', stage)
Expand Down Expand Up @@ -96,6 +97,17 @@ const oauthGithubSecret = OAUTH_GITHUB_SECRET
const oauthGoogleClientId = OAUTH_GOOGLE_CLIENT_ID
const oauthGoogleSecret = OAUTH_GOOGLE_SECRET

// const awsConfig: {
// region: string,
// credentials: {
// accessKeyId: string,
// secretAccessKey: string,
// },
// } = {
// region: nonMaybe(AWS_REGION),
// credentials,
// }

const awsConfig: {
region: string,
credentials: {
Expand All @@ -104,7 +116,10 @@ const awsConfig: {
},
} = {
region: nonMaybe(AWS_REGION),
credentials,
credentials: {
accessKeyId: '',
secretAccessKey: '',
},
}

const cdkEnvironment = env
Expand Down

0 comments on commit 6bb0866

Please sign in to comment.