Skip to content

Instantly share code, notes, and snippets.

@carmstrong
Last active August 29, 2015 14:00
Show Gist options
  • Save carmstrong/11272149 to your computer and use it in GitHub Desktop.
Save carmstrong/11272149 to your computer and use it in GitHub Desktop.
fleetctl queues job for scheduling
[Unit]
Description=a
[Service]
TimeoutStartSec=20m
ExecStart=/bin/bash -c "while true; do echo 'a...' && sleep 10; done"
[Install]
WantedBy=multi-user.target
[Unit]
Description=b
Requires=a.service
After=a.service
[Service]
TimeoutStartSec=20m
ExecStart=/bin/bash -c "while true; do echo 'b...' && sleep 10; done"
[Install]
WantedBy=multi-user.target
[X-Fleet]
X-ConditionMachineOf=a.service
$ fleetctl submit a.service b.service
$ fleetctl list-units
UNIT LOAD ACTIVE SUB DESC MACHINE
a.service - - - a -
b.service - - - b -
$ fleetctl start b.service
Job b.service still queued for scheduling
$ fleetctl list-units
UNIT LOAD ACTIVE SUB DESC MACHINE
a.service - - - a -
b.service - - - b -
@jonboulle
Copy link

This is all a bit in flux at the moment - the next release of fleet should definitely make it clearer what's going on here (one of our goals is to better report status for units that aren't scheduling, for example).

As to the behaviour you're hoping for, would it be something like the X-Requires/X-Wants mentioned in #287?

Do feel free to file issues against the fleet project for anything like this - sometimes we can be a little more responsive there than IRC :-)

@carmstrong
Copy link
Author

@jonboulle X-Requires/X-Wants is great for coordinating dependencies across the cluster, which is what's desired here. However, not sure why even when scheduling these two jobs on the same machine (this test scenario only had one machine in the cluster), the jobs are not starting properly.

PS I opened the issue as coreos/fleet#363

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment