The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

packer.md 3.6 KiB

4 년 전
4 년 전
4 년 전
4 년 전
4 년 전
4 년 전
4 년 전
4 년 전
4 년 전
4 년 전
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # Bubble Packer Images
  2. A [packer](https://packer.io) image is way to initialize a new cloud system with an operating system and
  3. software and files pre-installed. This is an oversimplified explanation but will suffice for our current needs.
  4. Before packer images, we launched Bubbles starting with "blank" Ubuntu systems and then did
  5. tons of installation and configuration. It took 20+ minutes to launch a new Bubble.
  6. We decided we could do better. Packer allows us to create Ubuntu images that already have
  7. PostgreSQL, Redis and nginx installed and configured, and lots more.
  8. Launching a Bubble is now faster (usually under 10 minutes) because all the standard software
  9. and configs are already present on the packer image that each launch starts with.
  10. We can make it even faster, and we plan to, but getting a new Bubble launched in less than 10 minutes
  11. is a real accomplishment, and Packer makes it possible.
  12. ## Image Types
  13. There are two types of packer images: `sage` and `node`
  14. A `sage` image is for deploying new Bubbles in Launcher mode. A launcher is called a `sage` in the Bubble API.
  15. A `node` image is for deploying new Bubbles in Node mode. A regular Bubble that acts as a VPN for devices is called a `node` in the Bubble API.
  16. Bubble will automatically use the appropriate image type based on the [Launch Type](launch-types.md)
  17. in effect for each launch.
  18. ## Launching a Bubble while Packer Images are Building
  19. If you try to launch a Bubble before the required packer image is ready,
  20. your Bubble launcher will detect that the image is in the process of being built,
  21. and wait until it is ready before trying to use it.
  22. In some cases the Bubble you were launching may time-out while packer images are building.
  23. When this happens, the packer images will continue being built, just wait until they are done before
  24. re-launching your Bubble.
  25. ## Image Validity
  26. The packer images are tied to a specific Bubble version. As long as the Bubble API launcher can find packer images
  27. that match its own version, it will be able to launch Bubbles.
  28. When your Bubble is upgraded, its version changes, so the old packer images are no longer valid.
  29. Your Bubble will automatically build new images the next time a Bubble is launched.
  30. If you'd prefer not to add a 20 minute delay (as packer images are built) to the next Bubble launch, you
  31. can manually rebuild the images after upgrading your Bubble server. See below.
  32. ## Manually Rebuilding Packer Images
  33. To ensure that all required packer images exist (build them if needed):
  34. ./bin/pack_bubble
  35. For more information, see:
  36. ./bin/pack_bubble --help
  37. Note: to use the `bin` tools, define environment variables `BUBBLE_USER`, `BUBBLE_PASS`, and `BUBBLE_API`
  38. appropriately for your Bubble. For example:
  39. export BUBBLE_USER=user@example.com
  40. export BUBBLE_PASSWORD=password
  41. export BUBBLE_API=https://bubble.example.com/api # deployed launcher
  42. export BUBBLE_API=http://127.0.0.1:8090/api # local launcher
  43. ./bin/pack_bubble
  44. ## Packer Build Status
  45. When packer images are being built, you can check status with:
  46. ./bin/pack_status
  47. This will show all running packer jobs, and all completed packer images.
  48. To only see running packer jobs:
  49. ./bin/pack_status running
  50. To only see completed packer images:
  51. ./bin/pack_status completed
  52. ### Packer Build Status in Logs
  53. If you're able to view the Bubble API logs, you'll see a line like the one below when a packer
  54. image has completed processing:
  55. ... [PackerJob.java:301] packer images created in 00:19:30.0933: [PackerImage(id=ce95fb4371175, name=packer_bubble_node_local_868d2fba8f83ab3591c60b7bade35_d1.1.4.8_a1.1.4.10_m1.1.4.21_1.4.20_20201117153449, regions=null)]