kazurayam / materialstore

A domain-specific file system to store "materials" (screenshots, HTML, JSON, XML) collected during End-to-End testings using Selenium WebDriver etc. Features to make "diff" and compiling HTML reports are also included. This is written in pure Java8
Apache License 2.0
0 stars 0 forks source link

AWS S3, want to create the "store" directory on the could storage #118

Closed kazurayam closed 10 months ago

kazurayam commented 2 years ago

Let me imagine that i want to develop an application on top of the "materialstore" on AWS. I would find it necessary to create a "store" on AWS S3.

How can I make it possible?

I want to develop an application runnable on EC2 with backing S3.

kazurayam commented 2 years ago

I should try mounting S3 as a local file system. I should check if materialstore works with it.

https://cloud.netapp.com/blog/amazon-s3-as-a-file-system

kazurayam commented 1 year ago

I think that the materialstore library do not need to worry about making IO to AWS S3 directly.

We can map S3 bucket to a local directory using tools like Cyberduck.

https://cyberduck.io/s3/

kazurayam commented 1 year ago

You can try using Amazon AWS S3 FileSystem Provider JSR-203 for Java 7 (NIO2) also known as S3FS.

https://stackoverflow.com/questions/41113119/java-nio-file-implementation-for-aws

kazurayam commented 1 year ago

I found that the com.kazurayam.materialstore.core.filesystem.StoreOnS3Test runs slow.

<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="com.kazurayam.materialstore.core.filesystem.StoreOnS3Test" tests="3" skipped="0" failures="0" errors="0" timestamp="2023-01-08T11:44:35" hostname="KAZUAKInoMacBook-Air-2.local" 
        time="27.354">
  <properties/>
  <testcase name="testCreateStore()" classname="com.kazurayam.materialstore.core.filesystem.StoreOnS3Test" 
        time="15.52"/>
  <testcase name="testS3fs()" classname="com.kazurayam.materialstore.core.filesystem.StoreOnS3Test" 
        time="11.833"/>
  <testcase name="testNewInstanceOnAwsS3()" classname="com.kazurayam.materialstore.core.filesystem.StoreOnS3Test" time="0.001"/>
  <system-out><![CDATA[]]></system-out>
  <system-err><![CDATA[[Test worker] INFO com.kazurayam.materialstore.core.filesystem.Material - root.getClass().toString()=class com.upplication.s3fs.S3Path
]]></system-err>
</testsuite>

I should study what is the bottleneck of speed in more detail .

kazurayam commented 1 year ago

I made the com.kazurayam.materialstore.core.filesystem.SotreOnS3Test class to do performance measurement using the Timekeeper library.

It took 28 seconds to execute the testS3fs() method.

The Timekeeper emitited the following measurement result.

Step duration graph
creating new FileSystem on S3 00:02 #
creating parent dir 00:00 #
writing a file 00:01 #
listing a dir 00:00 #
deleting a file 00:01 #
deleting a dir 00:02 #
closing the FileSystem 00:00 #
Average 00:01

The test method took 6+α seconds with the JUnit runner reported it took 28 seconds.

It seems that the JUnit took around 20 senconds to carry out the test. The overhead by JUnit seems to be heavy; heavier than I guessed.

This implies that the performance of s3fs is good enough; not so slow as I was worried about.

kazurayam commented 1 year ago

supported at version 0.15.0

kazurayam commented 10 months ago

This issue has not been finshed yet.

I reviewed this issue because the issue #437 required me to do so.

As of the latest v0.16.6

kazurayam commented 10 months ago

have changed to testImplementation libs.s3fs

kazurayam commented 10 months ago

derived https://github.com/kazurayam/materialstore/issues/458