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

CI acquia task number output? #84

Closed
danshumaker opened this issue May 15, 2020 · 4 comments
Closed

CI acquia task number output? #84

danshumaker opened this issue May 15, 2020 · 4 comments

Comments

@danshumaker
Copy link

danshumaker commented May 15, 2020

Issue that prompts the request
We use gitlab + kubernetes + acquia_cli to do autodeploys each night. Some nights the builds&deploys fail for various reasons. However the standard output does not indicate which Acquia task is the one that failed. We obviously know the job that failed but not the Acquia Task ID in the standard out. Usually, if there is a failure, we go to the Acquia Admin UI and browse through the task list and look for the failed job. This works fine until the acquia task list is truncated by the interface and we can no longer browse for the task in question.

Our output looks like this:

  Looking up notification                      
 < 1 sec [➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 6 secs [⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 >  Moving DB (WXXXXXXd8) from Sandbox2 to Dev
 11 secs [⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0% Looking up notification                      
 < 1 sec [➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 5 secs [⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 11 secs [⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 16 secs [⚬⚬⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 21 secs [⚬⚬⚬⚬⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 27 secs [⚬⚬⚬⚬⚬⚬⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 32 secs [⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 38 secs [⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 43 secs [⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 49 secs [⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 54 secs [⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0% [error]  Acquia task failed. 
 command terminated with exit code 1

Proposed Solution
What would be great is to see the task ID that the progress meter is monitoring so we can research them better. So an output like this would be great:

>  Backing up DB (WXXXXXXD8) on Dev
  Looking up notification                      
 < TASKID 993456 1 sec [➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 TASKID 993456 6 secs [⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 >  Moving DB (wXXXXXXXX8) from Sandbox2 to Dev
TASKID 993457 11 secs [⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0% Looking up notification                      
 < TASKID 993457 1 sec [➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 TASKID 993457 5 secs [⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 TASKID 993457 11 secs [⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 TASKID 993457 16 secs [⚬⚬⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 TASKID 993457 21 secs [⚬⚬⚬⚬⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%

Describe alternatives you've considered
I've only briefly looked through the options to see if one exists for this already. Does it?

@typhonius
Copy link
Owner

We have access to the notification ID from the task that kicks it off e.g. database backup so we could definitely display that in the output (notifications seem to be superseding tasks on the Acquia platform now).

I'll have a little play over the weekend and see how we can provide extra info here.

@danshumaker
Copy link
Author

Cool that sounds good! Thanks for looking into it. Back in the day I wrote a acquia api v1 deploy script that had a similar "wait_for_acquia" and print task info in it https://github.com/danshumaker/ac-deploy/blob/master/deploy#L389 .

@typhonius
Copy link
Owner

I took a little look at this today and we might not be able to provide the right information via the API to tie in with what is shown on the interface. I believe the reason for this is because Acquia has been migrating away from tasks and task IDs and over to 'notifications'.

What is shown in the Acquia interface is a task ID. In the inset image below, we can see that this is an eight digit number.
Environments___Acquia

When I made some API calls earlier to try and locate where we could source this from, I wasn't able to locate it; neither in the ​/notifications​/{notificationUuid} endpoint or the /applications/{applicationUuid}/tasks endpoint. Both of these now use the more up-to-date notification UUID which looks something like 573d1353-1be7-4f36-8345-d4ebe0cd48b8.

I'm going to reach out to Acquia in Slack and ask whether this task ID in the interface will eventually be replaced by a UUID because then we can simply print the UUID from Acquia Cli and have 1:1 parity between what the Cli tool displays and what is shown on the interface.

Potentially one thing that we can do in the interim is print out the notification UUID. You would then be able to use the Cli tool to look up that specific notification using acquiacli n:i <applicationUuid> <notificationUuid>

@typhonius
Copy link
Owner

The small change above provides an output as follows. I'll pop in a PR later today:

➜  acquia-cli git:(add-notification-uuid) ✗ acquiacli db:backup devcloud:acquiacli dev acquiacli
➜  Backing up DB (acquiacli) on DEV
 Notification 4fcee289-2ee5-413a-a819-bb9ee881c88f: completed
32 secs [⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬] 100%

➜  acquia-cli git:(add-notification-uuid) ✗ acquiacli n:i devcloud:acquiacli 4fcee289-2ee5-413a-a819-bb9ee881c88f
➜  ID: 4fcee289-2ee5-413a-a819-bb9ee881c88f
➜  Event: DatabaseBackupCreated
➜  Description: A "acquiacli" database backup has been created for "DEV".
➜  Status: completed
➜  Created: 2020-05-16 12:05:00
➜  Completed: 2020-05-16 12:05:29

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

No branches or pull requests

2 participants