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

File System settings #61

Closed
stefanofornari opened this issue Jun 17, 2023 · 7 comments · Fixed by #168
Closed

File System settings #61

stefanofornari opened this issue Jun 17, 2023 · 7 comments · Fixed by #168

Comments

@stefanofornari
Copy link
Contributor

AS A user
I WANT to pass file system configuration at file system creation (i.e. FileSystems.newFileSystem())
SO THAT I can set the run time behaviour of the file system

NOTES:

  1. we can use aws.region, aws.accessKey and aws.accessKeySecret for region and credentials
  2. we could introduce aws.protocol = http/https to specify which protocol to use for endpoint different than QWS S3
  3. we could introduce aws.endpoint to specify the endpoint to use if not otherwise given
  4. properties passed to newFileSystem() overwrites environment variables and system properties
  5. properties passed to newFileSystem() are overwritten by the values provided in URIs

@markjschreiber can you please provide feedback on the notes above?

@markjschreiber
Copy link
Contributor

Some guidance

  1. The AWS SDK will pickup the region and credentials from the standard environment parameters, config files and EC2 instance role, additional configuration options for these isn't needed.
  2. The protocol can just be derived from the endpoint URL/URI it is not needed separately
  3. We should not use aws because it may one day collide with another AWS configuration variable. We already have other environment variables like S3_SPI_READ_MAX_FRAGMENT_SIZE so maybe use s3spi.endpoint or S3_SPI_ENDPOINT
  4. Order of precedence is documented in the README.md and is currently:
    1 Java properties
    2 Environment variables (System properties)
    3 Default values

@stefanofornari
Copy link
Contributor Author

Thanks, this helps. There is only one bullet I am not sure I have got it right. bullet 2. URIs to access a bucket even in the case of an endpoint would be something like:

s3://endpoint.somewhere.com/bucket

The scheme/protocol is going to to be s3 anyway. Are you suggesting we should use s3://https://endpoint.somewhere.com/bucket ? This would probably not be parsed as a URI.

@markjschreiber
Copy link
Contributor

Can you give an example of an endpoint that you are wanting to process where you need to determine the protocol?

@dannycjones
Copy link

dannycjones commented Jun 19, 2023

Thanks, this helps. There is only one bullet I am not sure I have got it right. bullet 2. URIs to access a bucket even in the case of an endpoint would be something like:

s3://endpoint.somewhere.com/bucket

The scheme/protocol is going to to be s3 anyway. Are you suggesting we should use s3://https://endpoint.somewhere.com/bucket ? This would probably not be parsed as a URI.

Does it make more sense to keep endpoint as a separate parameter?

For example, configuring an environment variable like this:

S3_SPI_ENDPOINT=https://endpoint.somewhere.com/

Then, just go ahead and use the URI s3://bucket/.

If you needed to use HTTP rather than HTTPS, then that would be configurable in a consistent way with other S3 tooling. I believe this is what @markjschreiber is suggesting.


This is similar to AWS CLI where you can set the endpoint separately using a CLI option:

aws s3 --endpoint-url https://endpoint.somewhere.com ls s3://bucket/

Or Apache Hadoop's S3A connector using a system property:

bin/hadoop fs -D fs.s3a.endpoint=https://endpoint.somewhere.com -ls s3a://bucket/

@markjschreiber
Copy link
Contributor

Agree, I think endpoint is separate to the s3 bucket URI

@stefanofornari
Copy link
Contributor Author

Ok, I'll go with a separate parameter.

@stefanofornari
Copy link
Contributor Author

The name of the property is going to be s3.spi.endpoint

stefanofornari added a commit to stefanofornari/aws-java-nio-spi-for-s3 that referenced this issue Jun 25, 2023
stefanofornari added a commit to stefanofornari/aws-java-nio-spi-for-s3 that referenced this issue Jun 25, 2023
# Conflicts:
#	build.gradle
#	src/main/java/software/amazon/nio/spi/s3/S3BasicFileAttributes.java
#	src/main/java/software/amazon/nio/spi/s3/S3ClientStore.java
#	src/main/java/software/amazon/nio/spi/s3/S3FileSystem.java
#	src/main/java/software/amazon/nio/spi/s3/S3FileSystemProvider.java
#	src/main/java/software/amazon/nio/spi/s3/S3SeekableByteChannel.java
#	src/test/java/software/amazon/nio/spi/s3/S3ClientStoreEndpointTest.java
#	src/test/java/software/amazon/nio/spi/s3/S3ClientStoreTest.java
#	src/test/java/software/amazon/nio/spi/s3/S3FileSystemEndpointTest.java
#	src/test/java/software/amazon/nio/spi/s3/S3FileSystemProviderTest.java
#	src/test/java/software/amazon/nio/spi/s3/S3FileSystemTest.java
#	src/test/java/software/amazon/nio/spi/s3/S3PathTest.java
#	src/test/java/software/amazon/nio/spi/s3/S3SeekableByteChannelTest.java
#	src/test/java/software/amazon/nio/spi/s3/config/S3NioSpiConfigurationTest.java
stefanofornari added a commit to stefanofornari/aws-java-nio-spi-for-s3 that referenced this issue Jun 25, 2023
stefanofornari added a commit to stefanofornari/aws-java-nio-spi-for-s3 that referenced this issue Jun 25, 2023
stefanofornari added a commit to stefanofornari/aws-java-nio-spi-for-s3 that referenced this issue Jun 26, 2023
stefanofornari added a commit to stefanofornari/aws-java-nio-spi-for-s3 that referenced this issue Jun 29, 2023
stefanofornari added a commit to stefanofornari/aws-java-nio-spi-for-s3 that referenced this issue Jun 29, 2023
stefanofornari added a commit to stefanofornari/aws-java-nio-spi-for-s3 that referenced this issue Jun 29, 2023
stefanofornari added a commit to stefanofornari/aws-java-nio-spi-for-s3 that referenced this issue Jun 29, 2023
stefanofornari added a commit to stefanofornari/aws-java-nio-spi-for-s3 that referenced this issue Jun 29, 2023
stefanofornari added a commit to stefanofornari/aws-java-nio-spi-for-s3 that referenced this issue Jul 1, 2023
stefanofornari added a commit to stefanofornari/aws-java-nio-spi-for-s3 that referenced this issue Jul 1, 2023
stefanofornari added a commit to stefanofornari/aws-java-nio-spi-for-s3 that referenced this issue Jul 9, 2023
stefanofornari added a commit to stefanofornari/aws-java-nio-spi-for-s3 that referenced this issue Jul 9, 2023
markjschreiber pushed a commit that referenced this issue Sep 12, 2023
* New provider for 3rd party service using the URI scheme s3x://
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 a pull request may close this issue.

3 participants