Invalid GCS URI used for placement

When you start the job data stream (v.2.4.0) through the bank with all the included dependencies instead of using the path provided by the GCS seems that the folder gs: / created locally, and because of this data stream employees try to access <localjarfolderpath>/gs:/...instead of the real path GCS gs://... If I'm right, this does not apply to 1.xx data stream

Command example:

java -cp 0.1-1.0-SNAPSHOT-jar-with-dependencies.jar Main --stagingLocation=gs://test/staging/

Error in the cloud console:

Staged package 0.1-1.0-SNAPSHOT-jar-with-dependencies-89nvLkMzfT53iBBXlpW_oA.jar at location <localjarfolderpath>/gs:/test/staging/ is inaccessible. ... The pattern must be of the form "gs://<bucket>/path/to/file".

+4
source share
2 answers

, maven-assembly-plugin . maven-dependency-plugin maven-jar-plugin jar-- , Dataflow . , maven jar build:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <executions>
        <execution>
            <id>copy-dependencies</id>
            <phase>prepare-package</phase>
            <goals>
                <goal>copy-dependencies</goal>
            </goals>
            <configuration>
                <outputDirectory>${project.build.directory}/lib</outputDirectory>
                <overWriteReleases>false</overWriteReleases>
                <overWriteSnapshots>false</overWriteSnapshots>
                <overWriteIfNewer>true</overWriteIfNewer>
            </configuration>
        </execution>
    </executions>
</plugin>
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <configuration>
        <archive>
            <manifest>
                <addClasspath>true</addClasspath>
                <classpathPrefix>lib/</classpathPrefix>
                <mainClass>com.package.main</mainClass>
            </manifest>
        </archive>
    </configuration>
</plugin>

jar , :

java -jar my-dataflow-job.jar

, jar lib, , .

+2

- , pom.xml google-cloud-dataflow-java-sdk-all. , , .

0

Source: https://habr.com/ru/post/1695765/


All Articles