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

Upgrade Windshaft Followup #3127

Merged
merged 2 commits into from Jul 25, 2019
Merged

Upgrade Windshaft Followup #3127

merged 2 commits into from Jul 25, 2019

Conversation

@rajadain
Copy link
Member

rajadain commented Jul 19, 2019

Overview

Switch to systemctl for the bind mount

A bind mount was introduced for node_modules in 8c5d49a to prevent a race condition. The manner of its implementation made it apply only immediately after provisioning, and not when loading a provisioned VM. By moving that mount to systemctl, we ensure it is always loaded, and ready before the tiler service starts.

Report correct error in Rollbar

Previously, because Rollbar wasn't initialized with an environment, it would always default to development. With proper initialization, it reports the correct one for development, staging, and production.

Connects #3112

Demo

Tiler Service working correctly in development after reloading:

> vagrant reload tiler && vagrant ssh tiler -c 'sudo service mmw-tiler status' && notify
==> tiler: Attempting graceful shutdown of VM...
==> tiler: Checking if box 'bento/ubuntu-16.04' is up to date...
==> tiler: A newer version of the box 'bento/ubuntu-16.04' for provider 'virtualbox' is
==> tiler: available! You currently have version '201807.12.0'. The latest is version
==> tiler: '201906.18.0'. Run `vagrant box update` to update.
==> tiler: Clearing any previously set forwarded ports...
==> tiler: Clearing any previously set network interfaces...
==> tiler: Preparing network interfaces based on configuration...
    tiler: Adapter 1: nat
    tiler: Adapter 2: hostonly
==> tiler: Forwarding ports...
    tiler: 80 (guest) => 4000 (host) (adapter 1)
    tiler: 22 (guest) => 2222 (host) (adapter 1)
==> tiler: Running 'pre-boot' VM customizations...
==> tiler: Booting VM...
==> tiler: Waiting for machine to boot. This may take a few minutes...
    tiler: SSH address: 127.0.0.1:2222
    tiler: SSH username: vagrant
    tiler: SSH auth method: private key
==> tiler: Machine booted and ready!
==> tiler: Checking for guest additions in VM...
==> tiler: Setting hostname...
==> tiler: Configuring and enabling network interfaces...
==> tiler: Mounting shared folders...
    tiler: /vagrant => /Users/ttuhinanshu/dev/mmw
    tiler: /opt/tiler => /Users/ttuhinanshu/dev/mmw/src/tiler
==> tiler: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> tiler: flag to force provisioning. Provisioners marked to run always will still run.
● mmw-tiler.service - mmw-tiler
   Loaded: loaded (/etc/systemd/system/mmw-tiler.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-07-22 17:57:08 UTC; 4s ago
 Main PID: 1624 (node)
    Tasks: 7
   Memory: 114.6M
      CPU: 2.713s
   CGroup: /system.slice/mmw-tiler.service
           └─1624 /usr/local/bin/node server.js

Jul 22 17:57:08 tiler systemd[1]: Started mmw-tiler.
Connection to 127.0.0.1 closed.

Rollbar reporting environment correctly:

https://rollbar.com/WikiWatershed/ModelMyWatershed/items/37/

image

Copy link
Contributor

hectcastro left a comment

After applying the suggested changes, I was able to halt the virtual machine, bring it back online, and confirm that the bind mount was in place:

vagrant@tiler:~$ mount | grep node_modules
/dev/mapper/vagrant--vg-root on /opt/tiler/node_modules type ext4 (rw,relatime,errors=remount-ro,data=ordered)
@rajadain

This comment has been minimized.

Copy link
Member Author

rajadain commented Jul 22, 2019

Pushed a fixup with recommendations.

@rajadain rajadain force-pushed the tt/upgrade-windshaft-followup branch from 4c89104 to de44523 Jul 22, 2019
@rajadain rajadain marked this pull request as ready for review Jul 22, 2019
@rajadain

This comment has been minimized.

Copy link
Member Author

rajadain commented Jul 22, 2019

This is ready for another look. Notably there are no Testing Instructions, because the tiler VM has already been tested, and testing Rollbar would require deploying to Staging, which may be more trouble than it's worth. I ran the test on staging by manually copying the new code to the tiler EC2 instance and restarting the service on it, then testing. The demo section should show most of it.

@rajadain rajadain requested a review from hectcastro Jul 22, 2019
@rajadain rajadain force-pushed the tt/upgrade-django branch from 8eb8144 to 39e7d4c Jul 24, 2019
@rajadain rajadain force-pushed the tt/upgrade-windshaft-followup branch from de44523 to 920a732 Jul 24, 2019
@rajadain rajadain changed the base branch from tt/upgrade-django to develop Jul 24, 2019
@rajadain

This comment has been minimized.

Copy link
Member Author

rajadain commented Jul 24, 2019

@azavea-bot rebuild

rajadain added 2 commits Jul 18, 2019
A bind mount was introduced for node_modules in 8c5d49a to
prevent a race condition. The manner of its implementation
made it apply only immediately after provisioning, and not
when loading a provisioned VM. By moving that mount to
systemctl, we ensure it is always loaded, and ready before
the tiler service starts.
Previously, because Rollbar wasn't initialized with an
environment, it would always default to "development".
With proper initialization, it reports the correct one
for development, staging, and production.
@hectcastro hectcastro force-pushed the tt/upgrade-windshaft-followup branch from 920a732 to aaf34b2 Jul 25, 2019
@rajadain

This comment has been minimized.

Copy link
Member Author

rajadain commented Jul 25, 2019

Thanks for taking a look! Merging this now.

@rajadain rajadain assigned rajadain and unassigned hectcastro Jul 25, 2019
@rajadain rajadain merged commit 63a746d into develop Jul 25, 2019
2 checks passed
2 checks passed
default Build finished.
Details
model-my-watershed-pull-requests Build #4071 succeeded in 12 min
Details
@rajadain rajadain deleted the tt/upgrade-windshaft-followup branch Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.