Flink CLI

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Flink CLI

Steven Nelson
Hello!

I am working on automating our deployments to our Flink cluster. I had a couple questions about the flink cli.

1) I thought there was an "update" command that would internally manage the cancel with savepoint, upload new jar, restart from savepoint process.

2) Is there a way to get the Flink cli to output it's result in a json format? Right now I would need to parse the results of the "flink list" command to get the job id, cancel the job with savepoint, parse the results of that to get the savepoint filename, then restore using that. Parsing the output seems brittle to me.

Thought?
-Steve

Reply | Threaded
Open this post in threaded view
|

Re: Flink CLI

Oytun Tez
Hi Steven,

As much as I am aware,
1) no update call. our build flow feels a little weird to us as well. definitely requires scripting.
2) we are using Flink management API remotely in our build flow to 1) get jobs, 2) savepoint them, 3) cancel them etc. I am going to release a Python script for this soon.

---
Oytun Tez

M O T A W O R D
The World's Fastest Human Translation Platform.


On Wed, Apr 24, 2019 at 11:06 AM Steven Nelson <[hidden email]> wrote:
Hello!

I am working on automating our deployments to our Flink cluster. I had a couple questions about the flink cli.

1) I thought there was an "update" command that would internally manage the cancel with savepoint, upload new jar, restart from savepoint process.

2) Is there a way to get the Flink cli to output it's result in a json format? Right now I would need to parse the results of the "flink list" command to get the job id, cancel the job with savepoint, parse the results of that to get the savepoint filename, then restore using that. Parsing the output seems brittle to me.

Thought?
-Steve

Reply | Threaded
Open this post in threaded view
|

Re: Flink CLI

Zack Bartel
In reply to this post by Steven Nelson
Hi Steve,
I recently solved this problem using the REST api and some python scripts. The script has a function "upgrade_job" which will cancel with savepoint, optionally upload a new jar from the local filestystem or S3, and start the job from the savepoint including any changes in parallelism. We've used Jenkins to upload new jars to S3 and automated the deployment using saltstack and the attached python script.

Please let me know if you find a better way to do this!

Zack 



Reply | Threaded
Open this post in threaded view
|

Re: Flink CLI

Marc Rooding
In reply to this post by Oytun Tez
Hi Steven, Oytun

You may find the tool we open-sourced last year useful. It offers deploying and updating jobs with savepointing.

You can find it on Github: https://github.com/ing-bank/flink-deployer

There’s also a docker image available in Docker Hub.

Marc
On 24 Apr 2019, 17:29 +0200, Oytun Tez <[hidden email]>, wrote:
Hi Steven,

As much as I am aware,
1) no update call. our build flow feels a little weird to us as well. definitely requires scripting.
2) we are using Flink management API remotely in our build flow to 1) get jobs, 2) savepoint them, 3) cancel them etc. I am going to release a Python script for this soon.

---
Oytun Tez

M O T A W O R D
The World's Fastest Human Translation Platform.


On Wed, Apr 24, 2019 at 11:06 AM Steven Nelson <[hidden email]> wrote:
Hello!

I am working on automating our deployments to our Flink cluster. I had a couple questions about the flink cli.

1) I thought there was an "update" command that would internally manage the cancel with savepoint, upload new jar, restart from savepoint process.

2) Is there a way to get the Flink cli to output it's result in a json format? Right now I would need to parse the results of the "flink list" command to get the job id, cancel the job with savepoint, parse the results of that to get the savepoint filename, then restore using that. Parsing the output seems brittle to me.

Thought?
-Steve

Reply | Threaded
Open this post in threaded view
|

Re: Flink CLI

Oytun Tez
I had come across flink-deployer actually, but somehow didn't want to "learn" it... (versus just a bunch of lines in a script)

At some time with more bandwidth, we should migrate to this one and standardize flink-deployer (and later take this to mainstream Flink :P).

---
Oytun Tez

M O T A W O R D
The World's Fastest Human Translation Platform.


On Thu, Apr 25, 2019 at 3:14 AM Marc Rooding <[hidden email]> wrote:
Hi Steven, Oytun

You may find the tool we open-sourced last year useful. It offers deploying and updating jobs with savepointing.

You can find it on Github: https://github.com/ing-bank/flink-deployer

There’s also a docker image available in Docker Hub.

Marc
On 24 Apr 2019, 17:29 +0200, Oytun Tez <[hidden email]>, wrote:
Hi Steven,

As much as I am aware,
1) no update call. our build flow feels a little weird to us as well. definitely requires scripting.
2) we are using Flink management API remotely in our build flow to 1) get jobs, 2) savepoint them, 3) cancel them etc. I am going to release a Python script for this soon.

---
Oytun Tez

M O T A W O R D
The World's Fastest Human Translation Platform.


On Wed, Apr 24, 2019 at 11:06 AM Steven Nelson <[hidden email]> wrote:
Hello!

I am working on automating our deployments to our Flink cluster. I had a couple questions about the flink cli.

1) I thought there was an "update" command that would internally manage the cancel with savepoint, upload new jar, restart from savepoint process.

2) Is there a way to get the Flink cli to output it's result in a json format? Right now I would need to parse the results of the "flink list" command to get the job id, cancel the job with savepoint, parse the results of that to get the savepoint filename, then restore using that. Parsing the output seems brittle to me.

Thought?
-Steve

Reply | Threaded
Open this post in threaded view
|

Re: Flink CLI

Gary Yao-4
In reply to this post by Steven Nelson
Hi Steve,

(1)

    The CLI action you are looking for is called "modify" [1]. However, we want
    to temporarily disable this feature beginning from Flink 1.9 due to some
    caveats with it [2]. If you have objections, it would be appreciated if you
    could comment on the respective thread on the user/dev mailing list.

(2)

    There is currently no option to have the CLI output JSON. However, as others
    have pointed out, you can use the REST API to invoke actions on the cluster,
    such as drawing savepoints [3]. This is also what the CLI ultimately does
    [4].

Best,
Gary

[1] https://ci.apache.org/projects/flink/flink-docs-release-1.8/ops/cli.html
[2] http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/DISCUSS-Temporarily-remove-support-for-job-rescaling-via-CLI-action-quot-modify-quot-td27447.html
[3] https://ci.apache.org/projects/flink/flink-docs-release-1.8/monitoring/rest_api.html#jobs-jobid-savepoints
[4] https://github.com/apache/flink/blob/767fe152cb69a204261a0770412c8b28d037614d/flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java#L415-L424

On Wed, Apr 24, 2019 at 5:06 PM Steven Nelson <[hidden email]> wrote:
Hello!

I am working on automating our deployments to our Flink cluster. I had a couple questions about the flink cli.

1) I thought there was an "update" command that would internally manage the cancel with savepoint, upload new jar, restart from savepoint process.

2) Is there a way to get the Flink cli to output it's result in a json format? Right now I would need to parse the results of the "flink list" command to get the job id, cancel the job with savepoint, parse the results of that to get the savepoint filename, then restore using that. Parsing the output seems brittle to me.

Thought?
-Steve