11/4/2017 - Scroll down to find new method that doesn't require TWRP.
You will need to download the alpha version of twrp, snoke kernel r7-p2-root and magisk 14.3 (1437)
1. Reboot phone to bootloader.
2. fastboot flash boot Snoke-R7-P2-Root.img
3 fastboot boot twrp-3.1.1-alpha1-walleye.img
4. Once in twrp, start adb sideload.
5. From cmd, adb sideload Magisk-v14.3(1437).zip
6. Reboot and enjoy root!!!!!
All credit comes from this post.
11/4/2017 - Post updated.
Just wanted to add this as another option for those who may find this method easier. No TWRP needed.
I just found a much faster and easier way to install magisk on the wonderful Pixel 2...
1. Download Magisk Manager 5.4.0 apk
2. Open app and tap install
3. Use the patch boot img option.
4. Locate the patched_boot.img within internal sd/MagiskManager and move it to root of phone memory.
5. Send that file to your pc.
6. Boot to bootloader.
7. Input command into cmd "fastboot flash boot patched_boot.img"
8. Reboot and you have latest root package or whichever you downloaded.