1
votes

I have created one Spring boot application with @EnablesTask annotation and try to print the arguments in log.

package com.custom.samplejob;

import org.springframework.boot.CommandLineRunner;
import org.springframework.cloud.task.configuration.EnableTask;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableTask
public class TaskConfiguration {

    @Bean
    public CommandLineRunner commandLineRunner() {
        return args -> {
            System.out.println(args);
        };
    }
}

After I have run that mvn clean install to have the jar in local maven repo.

com.custom:samplejob:0.0.1-SNAPSHOT

Using custom docker-compose to run spring cloud data flow locally on windows using the below parameters

set HOST_MOUNT_PATH=C:\Users\user\.m2 (Local maven repository mounting)

set DOCKER_MOUNT_PATH=/root/.m2/

set DATAFLOW_VERSION=2.7.1

set SKIPPER_VERSION=2.6.1

docker-compose up

Using the below commend to register the app

app register --type task --name custom-task-trail-1 --uri maven://com.custom:samplejob:0.0.1-SNAPSHOT

Created task using UI(below URL) and lunch the task. Task was successfully launched.

http://localhost:9393/dashboard/#/tasks-jobs/tasks

These are the logs I can see in the docker-compose up terminal,

dataflow-server    | 2021-02-15 13:20:41.673  INFO 1 --- [nio-9393-exec-9] o.s.c.d.spi.local.LocalTaskLauncher      : Preparing to run an application from com.custom:samplejob:jar:0.0.1-SNAPSHOT. This may take some time if the artifact must be downloaded from a remote host.
dataflow-server    | 2021-02-15 13:20:41.693  INFO 1 --- [nio-9393-exec-9] o.s.c.d.spi.local.LocalTaskLauncher      : Command to be executed: /usr/lib/jvm/jre-11.0.8/bin/java -jar /root/.m2/repository/com/custom/samplejob/0.0.1-SNAPSHOT/samplejob-0.0.1-SNAPSHOT.jar --name=dsdsds --spring.cloud.task.executionid=38
dataflow-server    | 2021-02-15 13:20:41.702  INFO 1 --- [nio-9393-exec-9] o.s.c.d.spi.local.LocalTaskLauncher      : launching task custom-task-trail-1-48794885-9a0a-4c46-a2a1-299bf91763ad
dataflow-server    |    Logs will be in /tmp/4921907601400/custom-task-trail-1-48794885-9a0a-4c46-a2a1-299bf91763ad

But in task execution list, it's doesn't show the status and start date and end date of that task executions,

enter image description here

can some one help me to resolve this or am I missing anything here in local installation or task spring boot implementation wise?

1
Can you share the logs in /tmp/4921907601400/custom-task-trail-1-48794885-9a0a-4c46-a2a1-299bf91763ad? If not, do you see any errors?Mahmoud Ben Hassine
Hi @MahmoudBenHassine - I try to get the logs from the below commend, but its saying that no such file or directory. docker exec -it skipper more /tmp/4921907601400/custom-task-trail-1-48794885-9a0a-4c46-a2a1-299bf91763ad Output more: stat of /tmp/4921907601400/custom-task-trail-1-48794885-9a0a-4c46-a2a1-299bf91763ad failed: No such file or directory Can you guide me where to check this logs ?Pyla Srenu
You should look for the logs in the same host where the dataflow server is running.Mahmoud Ben Hassine
currently dataflow server was running on my windows using docker-compose. I dont see any errors on dataflow-server container logsPyla Srenu
these are the logs for the above problem, org.springframework.context.ApplicationContextException: Failed to start bean 'taskLifecycleListener'; nested exception is java.lang.IllegalArgumentException: Invalid TaskExecution, ID 2 not found @MahmoudBenHassinePyla Srenu

1 Answers

0
votes

I have enabled kubernetes on docker desktop and installed spring data flow server top of that. And I tried with docker uri to register app and generate docker image using the jib-maven-plugin.

Now its works the sample task application in my case.