Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infra for setting S3 bucket for storing datasets #147

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

andresgutgon
Copy link
Contributor

@andresgutgon andresgutgon commented Sep 9, 2024

What?

Set S3 bucket for storing datasets in latitude workspaces

TODO

  • Setup Pulumi config and AWS secrets for AWS access and secret
  • Setup S3 Policy in bucket Not necessary. User from AWS_ACCESS_KEY already has these permissions.
  • Setup bucket in the eu-central-1 region
  • Run pulumi up to create the bucket
  • Ask Gerard how we can avoid removing the bucket even if we run pulumi destroy

Next PR

  • Test the files are uploaded to S3 in development by setting the Driver as S3. Not working doing the fix in another PR to merge the Pulumi state

@andresgutgon andresgutgon added the 🚧 wip Work in progress label Sep 9, 2024
@andresgutgon andresgutgon force-pushed the feature/s3-infra-for-datasets branch from ba3a6b2 to fe04349 Compare September 9, 2024 14:48
@@ -1,24 +1,42 @@
import { debuglog } from 'node:util'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is super nice. It prints debug traces scoped by a string. I saw Flydrive used it

import { Result } from '@latitude-data/core/lib/Result'
import { env } from '@latitude-data/env'
import { Disk, errors } from 'flydrive'
import { FSDriver } from 'flydrive/drivers/fs'
import { S3Driver } from 'flydrive/drivers/s3'
import { WriteOptions } from 'flydrive/types'

var debug_default = debuglog('flydrive:s3')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case I tag these logs (temp hack to debug) as FlyDrive S3

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var? are we back to 2006 javascript? :trollface:

@andresgutgon andresgutgon force-pushed the feature/s3-infra-for-datasets branch 3 times, most recently from a8010db to b6e3ee9 Compare September 9, 2024 15:05
@andresgutgon andresgutgon removed the 🚧 wip Work in progress label Sep 9, 2024
await client.send(command)
} catch (error) {
debug_default('error pinging bucket %s', bucket)
debug_default('error pinging bucket %s', error)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we throw or do something with the exception here besides printing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method will be removed

geclos
geclos previously approved these changes Sep 9, 2024
@andresgutgon andresgutgon force-pushed the feature/s3-infra-for-datasets branch from 4c5a0f4 to 8a9487d Compare September 9, 2024 16:10
@geclos geclos force-pushed the feature/s3-infra-for-datasets branch from 983b1e2 to c39b0cd Compare September 9, 2024 16:23
@andresgutgon andresgutgon force-pushed the feature/s3-infra-for-datasets branch from c39b0cd to 81f46a5 Compare September 9, 2024 16:24
@andresgutgon andresgutgon force-pushed the feature/s3-infra-for-datasets branch from 81f46a5 to facceeb Compare September 9, 2024 16:29
const adapter = new DrizzlePostgreSQLAdapter(database, sessions, users)
const adapter = new DrizzlePostgreSQLAdapter(
// @ts-expect-error - No idea why this is happening
database,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea why started failing. Also in main. I'll try after merge and see if I can remove it

@andresgutgon andresgutgon merged commit 2c684ed into main Sep 9, 2024
3 checks passed
@andresgutgon andresgutgon deleted the feature/s3-infra-for-datasets branch September 9, 2024 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants