Tips and Tricks¶
Fugue CLI Tips and Tricks¶
Force-kill a process¶
Occasionally, there may be a need to force-kill a process. This
is handy if the process hangs in the
Killing state, or if you’re
just in a hurry. You can force-kill a process by suspending it and then
killing it once it’s suspended, using this command:
$ fugue suspend -y <FID or alias> && fugue kill -y <FID or alias>
If you’re still having trouble killing a process, reach out to email@example.com.
Kill all processes at once¶
This line of bash will kill all currently running or suspended processes:
$ for fid in $(fugue status --json | jq -r ..fid); do fugue kill -y $fid; done
Determine if an update is finished¶
Due to AWS’s eventual
sometimes it can take a little while for an
update to complete. If
you want to see what infrastructure operations are still pending on an
update, you can use this command:
$ fugue update <FID or alias> <composition> --dry-run
This returns a list of the remaining AWS API requests. If all you see is
JobId fields, then that means the update is complete
and there are no pending operations. That’ll look like this:
FID: 0b160a53-95d2-4ba6-b5f0-6c1abbf52c95 JobId: '1505427811' No requests generated.
For more information on dry-run output, see Using –dry-run To Preview Update Changes To Your Infrastructure.
Remove Existing RBAC Policy with a Blank Policy¶
In some instances rather than detaching your policy information with the
fugue policy rbac-detach command, you may want to remove it
You can easily make these changes by creating an empty/blank policy and
fugue policy rbac-attach to apply the blank policy file.
This will effectively return Fugue to its default state, e.g. a
configuration with a single
To start, if you run
fugue policy list-users you can display a list
of existing users and confirm the policy that’s applied.
$ fugue policy list-users Fugue User list for bob/xxxxxxxxxx - Wed Jan 25 2017 2:47pm User Name Enabled Created Updated ---------- --------- --------- --------- root yes 2:15pm 2:15pm bob yes 4:30pm 4:30pm fred yes 4:30pm 4:30pm
To remove this policy and all of the associated users and user secrets
simply use the
fugue policy rbac-attach command with a blank policy
file that contains the word composition to work as expected (e.g
$ cat blankpolicy.lw composition
$ fugue policy rbac-attach blankpolicy.lw Compiling Ludwig file blankpolicy.lw ... [ OK ] Successfully compiled. No errors. Uploading policy to S3 ... [ OK ] Successfully uploaded. Requesting the Conductor set new policy ... [ DONE ] Policy uploaded and applied.
fugue policy list-users command to confirm your policy was
updated and the data was removed.
$ fugue policy list-users Fugue User list for bob/xxxxxxxxxxx - Wed Jan 25 2017 2:58pm User Name Enabled Created Updated ---------- --------- --------- --------- root yes 2:15pm 2:15pm
Some items to note:
fugue policy rbac-attachwith a blank policy file will remove all non-root users and their corresponding user secrets.
- You can create the same users by running
fugue policy rbac-attachwith a previously authored policy, however all user secrets will need to be regenerated with
fugue policy generate-secret.
- To remove an existing RBAC policy simply use the
fugue policy rbac-detachcommand to detach the current policy. This method removes the policy but leaves any users and their corresponding user secrets intact.
Ludwig Tips and Tricks¶
Did you know that Fugue offers editor plug-ins so you can read and write Ludwig in your editor/IDE of choice? All plug-ins include Ludwig syntax highlighting, and some have additional features. See ludwig-mode for Emacs, ludwig-vim for vim, vscode-language-ludwig for the Ludwig LSP Server and VSCode, and language-ludwig for Atom.
Watch lwc for fast feedback¶
If you are working with Ludwig in an editor and on a platform with the
watch command (available on macOS via Homebrew), you can get
IDE-like fast feedback by running the following command in a separate
pane or window on-screen:
watch -n2 -- lwc --composition FILE
A similar behavior can be achieved in
while true; do clear; lwc --composition FILE; sleep 2; done