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

PM-524 - Mina Daemon - Implement Precomputed block upload on s3 #136

Merged

Conversation

kaozenn
Copy link
Collaborator

@kaozenn kaozenn commented Nov 12, 2023

Sorry about this bulky PR, it was not easy to refactor the gcp logic and incorporate the s3 one

@kaozenn kaozenn self-assigned this Nov 12, 2023
@kaozenn kaozenn force-pushed the PM-524-implement-precomputed-block-upload-for-punk-poll branch 3 times, most recently from 08b04bc to d5f50d5 Compare November 13, 2023 00:18
@kaozenn kaozenn force-pushed the PM-524-implement-precomputed-block-upload-for-punk-poll branch from d5f50d5 to 9bf2c41 Compare November 13, 2023 00:21
Copy link
Collaborator

@simisimis simisimis left a comment

Choose a reason for hiding this comment

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

looks very good! 👍


# This script is used to impersonate gcloud in the mina-daemon container and store the downloaded blocks in the /blocks directory

echo "gcloud authentication disabled by gcloud-impersonator.sh"
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this a placeholder for implementation later?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, It is just because gcloud binary is required, for the upload-to-gcloud flag. So I need to have also a fake script that can be executed to bypass the gcloud authentication

Comment on lines +41 to +43
if aws s3 ls "s3://${S3_BUCKET}/${block_name}" 2>&1; then
echo "=> File ${block_name} already exists in S3. Skipping."
else
Copy link
Collaborator

Choose a reason for hiding this comment

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

I can't believe that aws s3 does not have a flag like gsutil have -n. Because essentially you're making 2 api calls per file

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I agree. I'll keep that PR open and will double check it

Copy link
Collaborator

Choose a reason for hiding this comment

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

I checked it, there seem to be nothing on s3 api. Also sync api seems to be useless as with many objects it will become very slow very quick.
However I saw there's a flag --if-none-match on s3api api
Also I see this very old thread that has been opened/closed/opened for years
aws/aws-cli#2874

Comment on lines +431 to +434
{{- if .Values.deployment.storeBlocks.aws.enabled }}
- name: {{ .Release.Name }}-scripts
mountPath: /usr/bin/gsutil
subPath: gsutil-impersonator.sh
Copy link
Collaborator

Choose a reason for hiding this comment

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

I like that you kept a clear separation of what is a script and what it impersonates!

@kaozenn kaozenn merged commit 4683fee into main Nov 13, 2023
@kaozenn kaozenn deleted the PM-524-implement-precomputed-block-upload-for-punk-poll branch November 13, 2023 07:53
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