Skip to main content

Artifacts

Introduction

Artifacts represent a packaged Apache Flink program. For example, a Java DataStream program packaged as a JAR or a Python Table API program packaged as Python script.

Artifacts are Project-scoped and zoned.

artifact.yaml

_11
kind: Artifact
_11
apiVersion: core/v1alpha1
_11
zone: shared-aws-eu-west-1
_11
metadata:
_11
name: top-speed-windowing
_11
project: default
_11
spec:
_11
type: Jar
_11
jarOptions:
_11
entryClass: org.apache.flink.streaming.examples.windowing.TopSpeedwindowing
_11
mainArgs: ["--topic", "input-topic"]

There are different types of Artifacts and each type comes with some type specific options. Currently, only Artifacts of type Jar are supported.

artifact.yaml

_11
kind: Artifact
_11
apiVersion: core/v1alpha1
_11
zone: shared-aws-eu-west-1
_11
metadata:
_11
name: top-speed-windowing-v1
_11
project: default
_11
spec:
_11
type: Jar
_11
jarOptions:
_11
entryClass: org.apache.flink.streaming.examples.windowing.TopSpeedwindowing
_11
mainArgs: ["--topic", "input-topic"]

Lifecycle & Status

Artifacts are created in phase WaitingForUpload.

artifact.yaml

_6
kind: Artifact
_6
apiVersion: core/v1alpha1
_6
...
_6
status:
_6
phase: WaitingForUpload
_6
uri: ""

Once a file was uploaded, the status changes to Ready and the state.uri field is set. During uploading the state changes to Uploading. Should the upload fail or is aborted, the status changes back to WaitingForUpload.

artifact.yaml

_6
kind: Artifact
_6
apiVersion: core/v1alpha1
_6
...
_6
status:
_6
phase: Ready
_6
uri: s3://...

Once an Artifact is Ready it is immutable and no further upload is accepted. Jobs that reference this Artifact can be started now.

status.phase

flowchart TD; WaitingForUpload-->Uploading; Uploading-->Ready; Uploading-->WaitingForUpload; Ready-->Deleting; WaitingForUpload-->Deleting; Uploading-->Deleting;