Skip to content
This repository was archived by the owner on Mar 23, 2019. It is now read-only.

Add a visual indicator when an EC2 instance is terminated #121

Closed
helfi92 opened this issue Sep 18, 2018 · 44 comments
Closed

Add a visual indicator when an EC2 instance is terminated #121

helfi92 opened this issue Sep 18, 2018 · 44 comments
Labels
enhancement New feature or request

Comments

@helfi92
Copy link
Contributor

helfi92 commented Sep 18, 2018

When terminating an instance in the EC2 resources tab, we need to somehow let the user know that a request has been sent since the removal takes a bit of time. Using a material UI snackbar component is probably a good solution to inform the user.

@helfi92 helfi92 added the enhancement New feature or request label Sep 18, 2018
@mike44441
Copy link
Contributor

I would be interested in implementing this feature. If you have any advise, it would be very much appreciated!

@helfi92
Copy link
Contributor Author

helfi92 commented Oct 1, 2018

Definitely! I think the snackbar component is the way to go. Try importing it and see if you can render the snackbar with a message at the bottom of the screen. Once that's done, you can simply make sure that function is called when the user terminates one or all of the EC2 resources. Let me know if you have any questions :)

@helfi92
Copy link
Contributor Author

helfi92 commented Oct 1, 2018

To access the EC2 resources view (http://localhost:5080/aws-provisioner/gecko-t-linux-xlarge), you will need a taskcluster account and you'll need to be logged in. Let me know if you hit any blockers and I will try to help.

mike44441 added a commit to mike44441/taskcluster-web that referenced this issue Oct 2, 2018
…terminated

Using the snackbar tools, added snackbar session when EC2 is terminated

Placing a snackbar instance when the user interacts with the Terminate Instance at the bottom center of the screen and will eventully disappate with a given message.

For Enhancement taskcluster#121
@mike44441
Copy link
Contributor

If you have any feedback on this, let me know!

@helfi92
Copy link
Contributor Author

helfi92 commented Oct 2, 2018

A screenshot would be helpful :)

@mike44441
Copy link
Contributor

Hello, sorry about the late response. But when I was trying to test and lost my authentication, I am a little confused about this part in trying to get it to work again. I know that I have to get taskcluster-cli. I was wondering if there was some other login credentials, by default that are usable to be able to see the EC2 resources.

@helfi92
Copy link
Contributor Author

helfi92 commented Oct 4, 2018

All you need is taskcluster-CLI and the required scopes. Once you are logged in, there will be an error panel saying which scopes (permissions) are needed. You can show me a screenshot of the error and I will make sure you have those permissions :)

@mike44441
Copy link
Contributor

Alright, the error I am getting when trying to see the error is
screen shot 2018-10-04 at 12 31 05 pm

@helfi92
Copy link
Contributor Author

helfi92 commented Oct 4, 2018

Bad mac most probably means you are not properly authenticated. I see that you are logged in via Github. You should use Taskcluster CLI to log in. Next step would be to logout and login with manual credentials where you will get the client ID and access token from the Taskcluster CLI.

@mike44441
Copy link
Contributor

Would this be from the part in the web-server section involving using the taskcluster-cli to create a user and key? Because I am still unable to use the taskcluster in the command prompt after following the instruction and not having errors on the make.

@mike44441
Copy link
Contributor

screen shot 2018-10-04 at 1 06 36 pm

@helfi92
Copy link
Contributor Author

helfi92 commented Oct 4, 2018

If you're developing for taskcluster-cli then you'll need to use go. However, you'll only the program (not building for it). That being said, all you have to do is download the binary from https://github.com/taskcluster/taskcluster-cli#installation and run it.

@mike44441
Copy link
Contributor

Alright, I have been trying to do that on my Mac, but for some reason it won't run allow me to run the binaries. That's why I was trying through the go method before.

@helfi92
Copy link
Contributor Author

helfi92 commented Oct 4, 2018

The instructions then say you should chmod +x the binary. Did you do that?

chmod +x binary

where binary is the binary name.

@mike44441
Copy link
Contributor

Yes I did, which makes this more confusing, and I am recommended to use a unarchiver on it still after doing that.

@helfi92
Copy link
Contributor Author

helfi92 commented Oct 4, 2018

What happens when you try to run the file via the terminal?

./<binary-name>

@mike44441
Copy link
Contributor

This solution worked! But the problem now is, I assumed that this would create the path, and this does not seem to be the case, is there a path that I need to export for this as well that wasn't stated in the installation?

@helfi92
Copy link
Contributor Author

helfi92 commented Oct 5, 2018

I assumed that this would create the path

I'm not sure I understand what you mean here. Could you elaborate, please?

You need to do ./<binary-name> signin. This would open a browser to log you in. Once logged in, the terminal will output your credentials.

@mike44441
Copy link
Contributor

Awesome that did the job, but when looking at the login id, which sections belong to the Client_id and access token?

@helfi92
Copy link
Contributor Author

helfi92 commented Oct 5, 2018

What do you see in the terminal after you login?

TASKCLUSTER_CLIENT_ID belongs to the client id.
TASKCLUSTER_ACCESS_TOKEN belongs to the access token.

@mike44441
Copy link
Contributor

Credentials output as environment variables
mozilla-auth0/github|23268239|mike44441/taskcluster-web-server

@helfi92
Copy link
Contributor Author

helfi92 commented Oct 5, 2018

Right. Now you can open http://localhost:5080/aws-provisioner/gecko-t-linux-xlarge and click on "Sign In" from the left panel and click on "Sign In with credentials". Paste your client ID and access token there.

@mike44441
Copy link
Contributor

SO my question is in the long line is the first section up to the first bar ( | ) The id and the token is the numerical values. If this is the case, I have tried this already and when I input it I get
screen shot 2018-10-05 at 10 37 10 am

@helfi92
Copy link
Contributor Author

helfi92 commented Oct 5, 2018

The client ID you seem to be logged in as is set to mozilla-auth0/github. Correct me if I'm wrong but your terminal output had mozilla-auth0/github|23268239|mike44441/taskcluster-web-server as the client ID. Is there a reason for the difference? It should be:

screen shot 2018-10-05 at 1 39 41 pm

@mike44441
Copy link
Contributor

I was not given or could not find the access token.

@helfi92
Copy link
Contributor Author

helfi92 commented Oct 5, 2018

Do you see something different?

> ./taskcluster signin
Starting
Listening for a callback on: http://localhost:63410
Opening URL: https://tools.taskcluster.net/auth/clients/new?name=cli&description=Temporary+client+for+use+on+the+command+line&scope=%2A&expires=1d&callback_url=http%3A%2F%2Flocalhost%3A63410
export TASKCLUSTER_CLIENT_ID='mozilla-auth0/ad|Mozilla-LDAP|haali/cli'
export TASKCLUSTER_ACCESS_TOKEN='xxx'
Credentials output as environment variables

Could you show me a screenshot, please?

@mike44441
Copy link
Contributor

screen shot 2018-10-05 at 10 49 58 am

@helfi92
Copy link
Contributor Author

helfi92 commented Oct 5, 2018

OK good:

Opening URL: https://tools.taskcluster.net/auth/clients/new?name=cli&description=Temporary+client+for+use+on+the+command+line&scope=%2A&expires=1d&callback_url=http%3A%2F%2Flocalhost%3A63410 should have opened a new browser tab/window. Do you see that?

@mike44441
Copy link
Contributor

mike44441 commented Oct 5, 2018

Yeah, I put this exact command before and was not directed to this before. I had tried several times, but now it seems to be working then and I was able to log into the site and create the cli id now.
screen shot 2018-10-05 at 10 55 41 am
Now that I have a proper ID, I logged in and I am unable to modify my permissions.

@helfi92
Copy link
Contributor Author

helfi92 commented Oct 5, 2018

Try refreshing your page. Does the error go away?

@mike44441
Copy link
Contributor

screen shot 2018-10-05 at 10 59 59 am

@helfi92
Copy link
Contributor Author

helfi92 commented Oct 5, 2018

Could you try restarting the taskcluster-web-server process.

@mike44441
Copy link
Contributor

mike44441 commented Oct 5, 2018

I still get the same errors

But for some of the other AWS I am able to access, but not this one.

And if I try to delete an item.
screen shot 2018-10-05 at 11 07 17 am

@helfi92
Copy link
Contributor Author

helfi92 commented Oct 5, 2018

If you do git log --oneline -n 1 in the taskcluster-web-server, what do you see?

@mike44441
Copy link
Contributor

screen shot 2018-10-05 at 11 15 43 am

@helfi92
Copy link
Contributor Author

helfi92 commented Oct 5, 2018

Interesting. You can try rm -rf node_modules && rm -rf build && yarn && yarn start inside taskcluster-web-server and see if that works.

@mike44441
Copy link
Contributor

I did this, and although I still can't access http://localhost:5080/aws-provisioner/gecko-t-linux-xlarge. But I am able to access all of http://localhost:5080/aws-provisioner/gaia-cache

@helfi92
Copy link
Contributor Author

helfi92 commented Oct 5, 2018

Interesting. You should be able to continue with gaia-cache :) Sorry for all the overhead you had to go through.

@mike44441
Copy link
Contributor

All good! Thanks for all the help and trouble shooting.

@mike44441
Copy link
Contributor

Hey so I am trying to test the snack bar, but I get this error when I try to terminate individual tasks
screen shot 2018-10-05 at 12 27 18 pm

And when I do terminate all I get
screen shot 2018-10-05 at 12 28 24 pm

@helfi92
Copy link
Contributor Author

helfi92 commented Oct 5, 2018

Step number one would be to be able to display a snackbar with a message. Once that's done, we can hook it up to the terminate buttons. To test the snackbar, create a dummy button that would trigger the snackbar upon clicking on the button.

@mike44441
Copy link
Contributor

mike44441 commented Oct 8, 2018

I have been trying to generate a Snackbar when handling the terminate instance. But, I still can't get it to work and I think I will need permissions again to be able to see AWS Provisioner. I have coding, but I am unsure where I should try to insert the snackbar feature. Should I be trying to to this in
.../GitHub/taskcluster-web/src/views/AwsProvisioner/ViewWorkerType/index.jsx or
.../GitHub/taskcluster-web/src/components/Ec2ResourcesTable/index.jsx

mike44441 added a commit to mike44441/taskcluster-web that referenced this issue Oct 8, 2018
@helfi92
Copy link
Contributor Author

helfi92 commented Oct 9, 2018

I think it makes sense to put it under .../GitHub/taskcluster-web/src/views/AwsProvisioner/ViewWorkerType/index.jsx. Regarding permissions, you'll have to show me what kind of error you're getting so I could provide you with the relevant scopes (permissions).

@helfi92
Copy link
Contributor Author

helfi92 commented Oct 17, 2018

Now that we have migrated to material UI v3, many bugs in the Snackbar component have been fixed.

mike44441 added a commit to mike44441/taskcluster-web that referenced this issue Oct 19, 2018
…terminated

Using the snackbar tools, added snackbar session when EC2 is terminated

Placing a snackbar instance when the user interacts with the Terminate Instance at the bottom center of the screen and will eventully disappate with a given message.

For Enhancement taskcluster#121
mike44441 added a commit to mike44441/taskcluster-web that referenced this issue Oct 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants