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

Verify-Installation Command #153

Merged
merged 19 commits into from
Jul 20, 2021
Merged

Conversation

nahara7
Copy link
Contributor

@nahara7 nahara7 commented Jul 7, 2021

Addresses: #116

Intent

To simplify use of verify-installation command inside the container.

Approach

Verify Installation command was tricky to use in docker. This runs the command at startup and writes its output to a path referenced by the DIAGNOSTIC_DIR environment variable. Allows image tests to reference the log file. Additional environment variables added include:

DIAGNOSTIC_ENABLE : false by default. Runs verify installation command at startup

DIAGNOSTIC_ONLY : false by default. Only runs verify-installation command and then exits the script.

@nahara7 nahara7 mentioned this pull request Jul 7, 2021
@nahara7 nahara7 marked this pull request as ready for review July 7, 2021 17:25
@nahara7 nahara7 requested a review from colearendt July 7, 2021 17:26
Copy link
Member

@colearendt colearendt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! A couple of random ideas 😄

server-pro/Dockerfile Outdated Show resolved Hide resolved
server-pro/startup.sh Outdated Show resolved Hide resolved
server-pro/startup.sh Outdated Show resolved Hide resolved
server-pro/startup.sh Outdated Show resolved Hide resolved
@colearendt
Copy link
Member

colearendt commented Jul 7, 2021

Another idea I just had - when this "diagnostic report" ends, it will start the product as normal. Maybe we should have an environment variable that, if set, causes the script to exit 0 after the diagnostic report ends? i.e. DIAGNOSTIC_ONLY or something like that.

@nahara7
Copy link
Contributor Author

nahara7 commented Jul 7, 2021

Another idea I just had - when this "diagnostic report" ends, it will start the product as normal. Maybe we should have an environment variable that, if set, causes the script to exit 0 after the diagnostic report ends? i.e. DIAGNOSTIC_ONLY or something like that.

I like this ! Will do !

@nahara7 nahara7 requested a review from colearendt July 8, 2021 15:28
Copy link
Member

@colearendt colearendt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking really good! A few more little tidbits 😄

server-pro/startup.sh Outdated Show resolved Hide resolved
server-pro/startup.sh Outdated Show resolved Hide resolved
server-pro/startup.sh Show resolved Hide resolved
# Check diagnostic configurations
if [ "$DIAGNOSTIC_ENABLE" == "true" ]; then
/usr/local/bin/verify_installation.sh &
sleep 7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious - why the sleep?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally had a wait command. It took quite some time to fetch the job output at the end of the line.
...Job has finished running Fetching job output...
The sleep command allowed me to view the file when I was sure the directory existed but not waiting as long. Is there a different way you think I should do ?

server-pro/Dockerfile Outdated Show resolved Hide resolved
server-pro/startup.sh Outdated Show resolved Hide resolved
@nahara7 nahara7 requested a review from bdeitte July 19, 2021 20:09
Copy link
Contributor

@bdeitte bdeitte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! My only suggestion would be that we document the environment variables somewhere in a README. But my guess is this is a more wide-ranging issue related to docs and not sure if it conflicts with any of @colearendt's doc work that I haven't gotten a chance to look through.

@colearendt
Copy link
Member

colearendt commented Jul 20, 2021

Ok, had a long chat w/ the RSW team today. TL;DR; I think we need to:

  • remove the & / backgrounding of the verify-installation command
  • remove the sleep 5

What was happening with the hang you experienced was the product was stuck in a state where it could not start the job, but wasn't erroring and also wasn't timing out. The team is now aware and will hopefully improve the product to be a bit more clear in the long run, but backgrounding the process can actually hide some of these concerning issues, so I think foreground is the right call. If the product isn't working, we want to know about it! 😄

This is an example that reproduces the problem (using this branch / the public image after we merge):

docker run -v $(pwd)/server-pro/startup.sh:/usr/local/bin/startup.sh -e DIAGNOSTIC_ENABLE=true -e DIAGNOSTIC_ONLY=true -it --rm rstudio/rstudio-workbench:1.4.1717-3

And this example works as we expect (added --privileged) (I was mounting the startup script so I did not have to rebuild the image with each tweak)

docker run --privileged -v $(pwd)/server-pro/startup.sh:/usr/local/bin/startup.sh -e DIAGNOSTIC_ENABLE=true -e DIAGNOSTIC_ONLY=true -it --rm rstudio/rstudio-workbench:1.4.1717-3

I'm not super opinionated about docs, to be honest. I am AOK if we merge this and then follow up with docs once things have stabilized in the repo a bit. We've done a lot of work in this PR already 😄

I'll send y'all a link to the slack thread privately

@nahara7 nahara7 requested a review from colearendt July 20, 2021 17:44
Copy link
Member

@colearendt colearendt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woohoo! Looks awesome!

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

Successfully merging this pull request may close these issues.

None yet

3 participants