Giter Club home page Giter Club logo

byoc-tool's People

Contributors

mrepse avatar msterk avatar pkolaric avatar tomislijepcevic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

byoc-tool's Issues

Docker container does not build succesfully

The Docker container does not build succesfully.

root@sentinel-hub-test:~/byoc-tool# docker build --tag byoctool .
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

Sending build context to Docker daemon  1.652MB
Step 1/11 : FROM osgeo/gdal:alpine-small-3.3.0 AS build
 ---> 0ee1cd30678a
Step 2/11 : RUN apk add --no-cache openjdk8
 ---> Using cache
 ---> dd8b654f2946
Step 3/11 : ADD . .
 ---> 044ac7557e41
Step 4/11 : RUN ./gradlew test
 ---> Running in f5e5970e6c07
Downloading https://services.gradle.org/distributions/gradle-6.0.1-bin.zip
..........................................................................................

Welcome to Gradle 6.0.1!

Here are the highlights of this release:
 - Substantial improvements in dependency management, including
   - Publishing Gradle Module Metadata in addition to pom.xml
   - Advanced control of transitive versions
   - Support for optional features and dependencies
   - Rules to tweak published metadata
 - Support for Java 13
 - Faster incremental Java and Groovy compilation
 - New Zinc compiler for Scala
 - VS2019 support
 - Support for Gradle Enterprise plugin 3.0

For more details see https://docs.gradle.org/6.0.1/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)
> Task :compileJava
> Task :processResources
> Task :classes
> Task :compileTestJava
> Task :processTestResources
> Task :testClasses

> Task :test

com.sinergise.sentinel.byoctool.ingestion.CogFactoryTest > createCogFromMultiBandFile(int, String)[1] FAILED
    java.lang.RuntimeException at CogFactoryTest.java:58
        Caused by: com.sinergise.sentinel.byoctool.ingestion.IngestionException at CogFactoryTest.java:58

com.sinergise.sentinel.byoctool.ingestion.CogFactoryTest > createCogFromMultiBandFile(int, String)[2] FAILED
    java.lang.RuntimeException at CogFactoryTest.java:58
        Caused by: com.sinergise.sentinel.byoctool.ingestion.IngestionException at CogFactoryTest.java:58

com.sinergise.sentinel.byoctool.ingestion.CogFactoryTest > createCogFromMultiBandFile(int, String)[3] FAILED
    java.lang.RuntimeException at CogFactoryTest.java:58
        Caused by: com.sinergise.sentinel.byoctool.ingestion.IngestionException at CogFactoryTest.java:58

com.sinergise.sentinel.byoctool.ingestion.CogFactoryTest > createCogFromMultiBandFile(int, String)[4] FAILED
    java.lang.RuntimeException at CogFactoryTest.java:58
        Caused by: com.sinergise.sentinel.byoctool.ingestion.IngestionException at CogFactoryTest.java:58

com.sinergise.sentinel.byoctool.ingestion.CogFactoryTest > createCogWithCustomResampling() FAILED
    java.lang.RuntimeException at CogFactoryTest.java:58
        Caused by: com.sinergise.sentinel.byoctool.ingestion.IngestionException at CogFactoryTest.java:58

45 tests completed, 5 failed, 2 skipped

> Task :test FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':test'.
> There were failing tests. See the report at: file:///build/reports/tests/test/index.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1m 11s
5 actionable tasks: 5 executed
The command '/bin/sh -c ./gradlew test' returned a non-zero code: 1

upgrade twelvemonkeys dependency version

Hi, we found the insecure version of the dependency twelvemonkeys still used in the code : https://github.com/sentinel-hub/byoc-tool/blob/master/src/main/java/com/sinergise/sentinel/byoctool/tiff/TiffCompoundDirectory.java#L13, which may infinite loop in code. Test here:
JPEG link: https://github.com/haraldk/TwelveMonkeys/blob/4259903bddaadc94a7027ecece2351be3cd6ee9c/imageio/imageio-jpeg/src/test/resources/broken-jpeg/110115680-6d6dce80-7d84-11eb-99df-4cb21df3b09f.jpeg

public class TiffCompoundDirectoryTest {

    @Test(timeout = 1000L)
    public void testTiffCompoundDirectoryVulnerability() throws Exception {
        ImageInputStream malformedInput = createMalformedInput();

        try {
            new TiffCompoundDirectory(malformedInput);
        } catch (IIOException expected) {
            assertThat(expected.getMessage(), allOf(containsString("SOF"), containsString("stream")));
        }
    }

    private ImageInputStream createMalformedInput() throws IOException {
        File tempFile = File.createTempFile("temp-malformed", ".jpeg");

        ImageReader reader = createReader();

        try (ImageInputStream iis = ImageIO.createImageInputStream(getClassLoaderResource("/broken-jpeg/110115680-6d6dce80-7d84-11eb-99df-4cb21df3b09f.jpeg"))) {
            reader.setInput(iis);

            try {
                reader.read(0, null);
            } catch (IIOException expected) {
                assertThat(expected.getMessage(), allOf(containsString("SOF"), containsString("stream")));
            }
        }

        return ImageIO.createImageInputStream(tempFile);
    }

    private ImageReader createReader() {
        // Implement this method to return an ImageReader instance for JPEG
        // You can use the createReader() method from the original testInfiniteLoopCorrupt()
    }

    private static InputStream getClassLoaderResource(String path) {
        // Implement this method to return an InputStream for the given path
        // You can use the getClassLoaderResource() method from the original testInfiniteLoopCorrupt()
    }
}

Bucket location

byoc-tool only seems to work with an Amazon bucket located in EU Central (Frankfurt). If specifying a collection linked to a bucket in US-West (Oregon), the tool throws the following error:

2020-06-05 17:56:14,352 ERROR: Failed to ingest tiles.
java.lang.RuntimeException: Collection does not exist.
	at com.sinergise.sentinel.byoctool.ingestion.ByocIngestor.ingest(ByocIngestor.java:63)
	at com.sinergise.sentinel.byoctool.cli.IngestCmd.run(IngestCmd.java:157)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1729)
	at picocli.CommandLine.access$900(CommandLine.java:145)
	at picocli.CommandLine$RunAll.handle(CommandLine.java:2157)
	at picocli.CommandLine$RunAll.handle(CommandLine.java:2116)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:1935)
	at picocli.CommandLine.execute(CommandLine.java:1864)
	at com.sinergise.sentinel.byoctool.ByocTool.main(ByocTool.java:112)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.