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

feat: Extend SLTs to excercise remote data storage functionality #1874

Merged
merged 3 commits into from
Oct 4, 2023

Conversation

gruuya
Copy link
Contributor

@gruuya gruuya commented Oct 3, 2023

The simplest way to go about this seemed to be:

  • extending the server command to also accept the storage config options (as the local command)
  • add a script to spin up a MinIO server and create a bucket in it
  • Add a relevant invocation to the ci.yaml file to trigger all that

@gruuya gruuya self-assigned this Oct 3, 2023
--option access_key_id=$MINIO_ACCESS_KEY \
--option secret_access_key=$MINIO_SECRET_KEY \
--option bucket=$MINIO_BUCKET \
'sqllogictests_native/*'
Copy link
Contributor Author

@gruuya gruuya Oct 3, 2023

Choose a reason for hiding this comment

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

We probably want to include a couple more tests that are heavy on native DDL & DML statements, so as to exercise the remote object store as much as possible. What would be some good paths to add here?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should run the sqllogictests/* tests as well using this. Most of the DDL/DML tests lie there!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great, thanks for the info!

@@ -43,6 +43,9 @@ pub struct ServerArgs {
#[clap(short, long, hide = true, value_parser)]
pub service_account_path: Option<String>,

#[clap(flatten)]
pub storage_config: StorageConfigArgs,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

hide doesn't play nicely with flatten it seems, so this will appear on help invocations.

Copy link
Member

Choose a reason for hiding this comment

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

Not the worst thing. I started adding in hide just so users wouldn't be confused about options that they shouldn't be setting (e.g. segment keys).

@@ -69,6 +69,8 @@ fn main() -> Result<()> {
None,
None,
None,
Default::default(),
None,
Copy link
Member

Choose a reason for hiding this comment

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

This function getting intense with all the Options.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah; I think there's a remote chance we can deprecate/consolidate data_dir and service_account_key into storage config so we'll be back to previous situation.

@@ -43,6 +43,9 @@ pub struct ServerArgs {
#[clap(short, long, hide = true, value_parser)]
pub service_account_path: Option<String>,

#[clap(flatten)]
pub storage_config: StorageConfigArgs,
Copy link
Member

Choose a reason for hiding this comment

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

Not the worst thing. I started adding in hide just so users wouldn't be confused about options that they shouldn't be setting (e.g. segment keys).

Comment on lines 30 to 44
docker run --rm --net=host --entrypoint=/bin/sh -i minio/mc:latest <<EOF
#!/usr/bin/mc

# Wait for minio server to become ready
curl --retry 10 -f --retry-connrefused --retry-delay 1 http://localhost:9000/minio/health/live

# Configure mc to connect to our above container as host
mc config host add glaredb_minio http://localhost:9000 $MINIO_ACCESS_KEY $MINIO_SECRET_KEY

# Remove the bucket if it already exists
mc rm -r --force glaredb_minio/"$MINIO_BUCKET"

# Finally create the test bucket
mc mb glaredb_minio/"$MINIO_BUCKET"
EOF
Copy link
Member

Choose a reason for hiding this comment

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

Crazy shell skills

Copy link
Contributor

Choose a reason for hiding this comment

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

what's mc and does writing to stdin of /bin/sh respect a shebang? (I have no idea!) It's probably the case that you're not calling mc from within the mc` shell....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, that's just a leftover from my previous attempt to get this working. Removing now.

Copy link
Contributor

@vrongmeal vrongmeal left a comment

Choose a reason for hiding this comment

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

This generally looks good. Just one comment about adding more tests (sqllogictests/*) to this and then we should be good to merge!

PS: How do we feel about segregating the different SLTs into their own jobs in CI? @scsmithr @tychoish

@tychoish
Copy link
Contributor

tychoish commented Oct 3, 2023

How do we feel about segregating the different SLTs into their own jobs in CI?

If by "jobs" you mean "tasks" in the workflow file, I feel great about it...

I think we would need to make the current slt fixture something that was more easily reproduceably locally (and so the CI operations look like the local operation), so I think (long term), we would want:

  • a docker compose (maybe with tilt?) file to set up all of the services and containers for the SLT tests
  • a justfile for actually running the tests directly,

Copy link
Contributor

@tychoish tychoish left a comment

Choose a reason for hiding this comment

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

I think this is fine to merge in its current form; I think in the medium term we could/should do a little cleanup with our integration test orchestration, but we don't need to block this PR on that (though @vrongmeal or @gruuya can/should coordinate on some of those details.)

@gruuya gruuya enabled auto-merge (squash) October 4, 2023 04:54
@gruuya gruuya merged commit 7c5ca07 into main Oct 4, 2023
@gruuya gruuya deleted the remote-data-store-slts branch October 4, 2023 05:03
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.

4 participants