Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worker doesn't pick up the new workflow #125

Closed
Cbkhare opened this issue Jan 29, 2021 · 3 comments
Closed

Worker doesn't pick up the new workflow #125

Cbkhare opened this issue Jan 29, 2021 · 3 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects

Comments

@Cbkhare
Copy link
Contributor

Cbkhare commented Jan 29, 2021

When a worker is rebooted via an action in the workflow, The worker picks up the workflow which is stuck in running state and as a result, it never picks up the new workflow.
This is in reference to the recent commit #115.

Expected Behaviour

Ideally, changes in this commit #115 should be rectified to handle the following scenario.

  • tink-server should have a mechanism to execute/resume running workflow after reboot.
  • When rebooted via workflow either workflow should be marked as completed.
  • Or worker should pick up new workflow (if there is one defined for it).

Current Behaviour.

Below are the stepwise states happening right now.

Steps to Reproduce (for bugs)

  • Create a workflow using the below template.
  • Use any alpine image for executing reboot action.
version: "0.1"
name: try-install
global_timeout: 1800
tasks:
  - name: "hello world"
    worker: "{{.device_1}}"
    actions:
      - name: "hello_world"
        image: hello-world
        timeout: 60
      - name: "reboot"
        image: alpine-image
        command:
          - bash
          - -c
          - |
            echo 1 > /proc/sys/kernel/sysrq; echo b > /proc/sysrq-trigger

Observe steps as mentioned in current behaviour.

  • State of first workflow
docker exec -i deploy_tink-cli_1 tink workflow state 88241ed8-6221-11eb-af88-0242ac120005 
+----------------------+--------------------------------------+
| FIELD NAME           | VALUES                               |
+----------------------+--------------------------------------+
| Workflow ID          | 88241ed8-6221-11eb-af88-0242ac120005 |
| Workflow Progress    | 50%                                  |
| Current Task         | hello world                          |
| Current Action       | reboot                               |
| Current Worker       | 0eba0bf8-3772-4b4a-ab9f-6ebe93b90a95 |
| Current Action State | STATE_RUNNING                        |
+----------------------+--------------------------------------+
  • state of the worker after reboot action.

image

vagrant@provisioner:/vagrant/deploy/centos$ docker exec -i deploy_tink-cli_1 tink workflow state 88241ed8-6221-11eb-af88-0242ac120005 
+----------------------+--------------------------------------+
| FIELD NAME           | VALUES                               |
+----------------------+--------------------------------------+
| Workflow ID          | 88241ed8-6221-11eb-af88-0242ac120005 |
| Workflow Progress    | 50%                                  |
| Current Task         | hello world                          |
| Current Action       | reboot                               |
| Current Worker       | 0eba0bf8-3772-4b4a-ab9f-6ebe93b90a95 |
| Current Action State | STATE_RUNNING                        |
+----------------------+--------------------------------------+
vagrant@provisioner:/vagrant/deploy/centos$ docker exec -i deploy_tink-cli_1 tink workflow state 5894621e-6222-11eb-af88-0242ac120005
+----------------------+--------------------------------------+
| FIELD NAME           | VALUES                               |
+----------------------+--------------------------------------+
| Workflow ID          | 5894621e-6222-11eb-af88-0242ac120005 |
| Workflow Progress    | 0%                                   |
| Current Task         |                                      |
| Current Action       |                                      |
| Current Worker       |                                      |
| Current Action State | STATE_PENDING                        |
+----------------------+--------------------------------------+

Result: If used for OS installation and worker is rebooted as a part of the workflow. The worker will never come up.

Context

  • Creating a centos workflow.

Your Environment

  • Vagrant
@Cbkhare Cbkhare added kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels Jan 29, 2021
@Cbkhare Cbkhare added this to Requests in Issues List via automation Jan 29, 2021
@mmlb
Copy link
Contributor

mmlb commented Feb 1, 2021

We can't do anything about this at the moment I think. The way around this is to sleep for a little bit before doing the echo so that tink-worker has had the ability to send progress to tink-server.

@mmlb
Copy link
Contributor

mmlb commented Feb 1, 2021

Hmm can you give boots logs for the attempted dhcp. It should allow the dhcp/tftp/...netboot.

@mmlb
Copy link
Contributor

mmlb commented Feb 17, 2021

The action is the issue here, as written it doesn't allow for tink-server to report back success and so naturally we re-run it. This is working as intended. You'll want to use the reboot action from tinkerbell/actions#13 when its ready.

@mmlb mmlb closed this as completed Feb 17, 2021
Issues List automation moved this from Requests to Just shipped Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
No open projects
Issues List
  
Just shipped
Development

No branches or pull requests

3 participants