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

Appliance systemd overhaul #1300

Merged
18 commits merged into from Jan 17, 2018
Merged

Appliance systemd overhaul #1300

18 commits merged into from Jan 17, 2018

Conversation

ghost
Copy link

@ghost ghost commented Jan 9, 2018

Fixes #1215, fixes #1265, fixes #1267, and improves the reliability of our systemd configuration.

This change introduces a new systemd target, psc-ready.target, that component services relying on psc tokens may use as a Requires dependency.

A new service, vic-appliance-wait-psc-config.service, has be been introduced that mimics the functionality of systemd's wait-network-online, where the waiting unit is triggered as active when a psc configuration is present. This replaces the use of path files in the vic 1.3 ova.

Changes also introduce another target, vic-appliance.target that is used as the boot-level target as a systemd best practice.

The final change is the introduction of reconfigure_token.service, a script that restarts admiral and harbor if there are any changes to the psc configuration file. This is most useful during re-initialization, where altered config options need to be propagated to admiral and harbor.

Jason Morris and others added 13 commits January 9, 2018 11:55
Minor unit name fixes

Revert bad changes to component services
Update test markdown

Fix bad test variable name

Fix broken keyword

Add extra time for selenium tests

Bump wait time some more

Sleep before adding default users
Dont block on harbor/admiral restart

Final fixes for startup units
Decrease harbor and admiral test timeouts
@ghost
Copy link
Author

ghost commented Jan 9, 2018

Opening this after I've closed #1266 to force drone to refresh merge refs, and to provide a clean slate for final review.

Copy link
Contributor

@mdharamadas1 mdharamadas1 left a comment

Choose a reason for hiding this comment

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

Couple of suggestions on tests.

@@ -27,6 +27,15 @@ ${cp-card-status-stopped} STOPPED

*** Keywords ***
Setup Base State
Log To Console \nWaiting for Admiral to come up...
Copy link
Contributor

Choose a reason for hiding this comment

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

Here is the suggestion so that we don't have to repeat this in every suite file. Convert this new code block to a new keyword in OVA-Util.robot and call it inOVA-Setup.robot after line 29.

Copy link
Author

Choose a reason for hiding this comment

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

Done, good idea, thanks!

@@ -91,8 +91,7 @@ Global Setup With Complete OVA Installation
# UI tests variables
Set Global Variable ${FIREFOX_BROWSER} firefox
Set Global Variable ${GRID_URL} http://127.0.0.1:4444/wd/hub
Set Global Variable ${EXPLICIT_WAIT} 30
Set Global Variable ${EXTRA_EXPLICIT_WAIT} 50
Set Global Variable ${EXPLICIT_WAIT} 60
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets keep EXPLICIT_WAIT to 30 as its used commonly, instead update existing EXTRA_EXPLICIT_WAIT to 60 and use it.

Copy link
Author

Choose a reason for hiding this comment

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

Done.

@ghost ghost mentioned this pull request Jan 10, 2018
Copy link
Contributor

@anchal-agrawal anchal-agrawal left a comment

Choose a reason for hiding this comment

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

PSC changes look good - could you verify that Admiral and Harbor start successfully (w.r.t. PSC) in the following situations:

  • The OVA is restarted
  • The appliance re-initialize button is used

We should ensure that the get_token service isn't affected, the Admiral page shows any older data if present, and service startup dependencies w.r.t. PSC are honored.

Also, is this change intended for 1.3.1 too?

@ghost
Copy link
Author

ghost commented Jan 16, 2018

@anchal-agrawal Thanks, I'll take a look at a restarted ova. I've verified the other scenarios.
Also, to my knowledge, not intended for 1.3.1.

@andrewtchin
Copy link
Contributor

definitely not in 1.3.1

@ghost
Copy link
Author

ghost commented Jan 16, 2018

@anchal-agrawal I've verified Harbor and Admiral start properly after a reboot. Get_token starts when the system boots, because it's needed by the psc-ready target. Token_reconfigure does not run on boot, as expected, so the token is valid. Looks good 👍

Copy link
Contributor

@anchal-agrawal anchal-agrawal left a comment

Choose a reason for hiding this comment

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

PSC changes LGTM - nice work!

@andrewtchin
Copy link
Contributor

Looks good after reinit

root@Photon [ ~ ]# systemctl list-jobs
 JOB UNIT                      TYPE    STATE
1400 reconfigure_token.service start   running
1679 harbor.service            restart running
1669 admiral.service           restart waiting
1578 get_token.service         restart waiting
1670 psc-ready.target          restart waiting

root@Photon [ ~ ]# systemctl list-jobs
 JOB UNIT                      TYPE    STATE
1400 reconfigure_token.service start   running
1679 harbor.service            start   waiting
1669 admiral.service           restart running
1578 get_token.service         restart waiting
1670 psc-ready.target          restart waiting

root@Photon [ ~ ]# systemctl list-jobs
 JOB UNIT                      TYPE  STATE
1400 reconfigure_token.service start running
1679 harbor.service            start waiting
1669 admiral.service           start waiting
1578 get_token.service         start running
1670 psc-ready.target          start waiting

root@Photon [ ~ ]# systemctl list-jobs
 JOB UNIT            TYPE    STATE
1679 harbor.service  start   waiting
1669 admiral.service restart running

root@Photon [ ~ ]# systemctl list-jobs
 JOB UNIT           TYPE  STATE
1679 harbor.service start running

@andrewtchin
Copy link
Contributor

Looks good after reboot

root@Photon [ ~ ]# systemctl list-jobs
JOB UNIT                 TYPE  STATE
117 get_token.service    start running
  1 vic-appliance.target start waiting
114 harbor.service       start waiting
113 fileserver.service   start running
115 psc-ready.target     start waiting
118 admiral.service      start waiting

root@Photon [ ~ ]# systemctl list-jobs
JOB UNIT                 TYPE  STATE
  1 vic-appliance.target start waiting
114 harbor.service       start waiting
113 fileserver.service   start running
118 admiral.service      start running

root@Photon [ ~ ]# systemctl list-jobs
JOB UNIT                 TYPE  STATE
  1 vic-appliance.target start waiting
114 harbor.service       start waiting
118 admiral.service      start running

root@Photon [ ~ ]# systemctl list-jobs
JOB UNIT                 TYPE  STATE
  1 vic-appliance.target start waiting
114 harbor.service       start running

@@ -0,0 +1,9 @@
[Unit]
Description=Reload PSC configuration.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit but maybe this can be something like "Watch Admiral psc-config.properties for PSC token refresh"

Copy link
Contributor

@andrewtchin andrewtchin left a comment

Choose a reason for hiding this comment

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

awesome :-)

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants