Introduce packer support (#18)
cleanups and fixes, packer is ready to roll
add errorApi endpoint
initialize mitmproxy dependencies
packer deployments finally working
fix virtualenv call for ubuntu 20.04
WIP. update to ubuntu 20.04. fixing algo installation
WIP. packer fixes
remove unused constant
WIP. packer basics working for ec2
Merge branch 'master' of git.bubblev.org:bubblev/bubble into cobbzilla/introduce_packer
remove automation dir, all moved to resources
log pg autovacuum if longer than 250ms
touch install marker for algo
set mitmproxy as owner of all mitmproxy files
add hostname to packer image name
avoid closing progress meter prematurely
WIP. parallelize node startup, fix packer bugs
clarify docs
add missing vars, algo tweaks
add missing vars, update algo hash
WIP. improving algo/mitmproxy packer stuff
install packer for sage, call packer from proper location
Use compute driver to get regions
improve comments
wait longer before polling new vultr server, avoid spurious ok status
unquote simple filenames
WIP. Use packer key, no more instance ssh key. Change API installation. Simplify packer/ansible.
rename bubble_finalizer to just finalizer, remove default_roles
filter servers/images based on installType
for now, consider packer image OK if bubble version matches
add algo/mitm roles to packer. add installType to BubbleNode
fix NODE_ROLES file
templatize packer file and playbook, use same template for sage and node
WIP: refactor addAllRegions
WIP: do not re-create identical images
WIP: packer build for vultr now working
Merge branch 'master' of git.bubblev.org:bubblev/bubble into cobbzilla/introduce_packer
WIP. working on vultr packer builds
WIP: packer image creation working for digitalocean
WIP: packer basics working for digitalocean
add packer endpoints, introduce packer support to cloud compute drivers
remove roles endpoints
AnsibleRole is no longer an model entity. Introduce Packer.
Merge branch 'sfedoriv/APIAddSupportForAmazonEC2ComputeCloudService' of git.bubblev.org:bubblev/bubble into sfedoriv/APIAddSupportForAmazonEC2ComputeCloudService
Merge branch 'master' of git.bubblev.org:bubblev/bubble into sfedoriv/APIAddSupportForAmazonEC2ComputeCloudService
Merge branch 'master' into sfedoriv/APIAddSupportForAmazonEC2ComputeCloudService
Merge branch 'master' into sfedoriv/APIAddSupportForAmazonEC2ComputeCloudService
Merge branch 'master' into sfedoriv/APIAddSupportForAmazonEC2ComputeCloudService
Merge branch 'master' into sfedoriv/APIAddSupportForAmazonEC2ComputeCloudService
Add instance count to script
Co-authored-by: Jonathan Cobb <jonathan@kyuss.org>
Co-authored-by: Svitlana <sfedoriv@itekako.com>
Reviewed-on: https://git.bubblev.org/bubblev/bubble/pulls/18
4 лет назад Introduce packer support (#18)
cleanups and fixes, packer is ready to roll
add errorApi endpoint
initialize mitmproxy dependencies
packer deployments finally working
fix virtualenv call for ubuntu 20.04
WIP. update to ubuntu 20.04. fixing algo installation
WIP. packer fixes
remove unused constant
WIP. packer basics working for ec2
Merge branch 'master' of git.bubblev.org:bubblev/bubble into cobbzilla/introduce_packer
remove automation dir, all moved to resources
log pg autovacuum if longer than 250ms
touch install marker for algo
set mitmproxy as owner of all mitmproxy files
add hostname to packer image name
avoid closing progress meter prematurely
WIP. parallelize node startup, fix packer bugs
clarify docs
add missing vars, algo tweaks
add missing vars, update algo hash
WIP. improving algo/mitmproxy packer stuff
install packer for sage, call packer from proper location
Use compute driver to get regions
improve comments
wait longer before polling new vultr server, avoid spurious ok status
unquote simple filenames
WIP. Use packer key, no more instance ssh key. Change API installation. Simplify packer/ansible.
rename bubble_finalizer to just finalizer, remove default_roles
filter servers/images based on installType
for now, consider packer image OK if bubble version matches
add algo/mitm roles to packer. add installType to BubbleNode
fix NODE_ROLES file
templatize packer file and playbook, use same template for sage and node
WIP: refactor addAllRegions
WIP: do not re-create identical images
WIP: packer build for vultr now working
Merge branch 'master' of git.bubblev.org:bubblev/bubble into cobbzilla/introduce_packer
WIP. working on vultr packer builds
WIP: packer image creation working for digitalocean
WIP: packer basics working for digitalocean
add packer endpoints, introduce packer support to cloud compute drivers
remove roles endpoints
AnsibleRole is no longer an model entity. Introduce Packer.
Merge branch 'sfedoriv/APIAddSupportForAmazonEC2ComputeCloudService' of git.bubblev.org:bubblev/bubble into sfedoriv/APIAddSupportForAmazonEC2ComputeCloudService
Merge branch 'master' of git.bubblev.org:bubblev/bubble into sfedoriv/APIAddSupportForAmazonEC2ComputeCloudService
Merge branch 'master' into sfedoriv/APIAddSupportForAmazonEC2ComputeCloudService
Merge branch 'master' into sfedoriv/APIAddSupportForAmazonEC2ComputeCloudService
Merge branch 'master' into sfedoriv/APIAddSupportForAmazonEC2ComputeCloudService
Merge branch 'master' into sfedoriv/APIAddSupportForAmazonEC2ComputeCloudService
Add instance count to script
Co-authored-by: Jonathan Cobb <jonathan@kyuss.org>
Co-authored-by: Svitlana <sfedoriv@itekako.com>
Reviewed-on: https://git.bubblev.org/bubblev/bubble/pulls/18
4 лет назад |
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- #!/bin/bash
- #
- # Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
- #
- # Usage:
- #
- # bpatch [user@]hostname [norestart]
- #
- # [user@]hostname : the hostname of the bubble node to update. Optionally, also specify a username.
- # Usually you will have an entry in ~/.ssh/config to set the username and ssh key
- # norestart : If present, do not restart the API server after updating the jar file
- #
- # Patch the bubble.jar on a remote node.
- #
- # Environment variables
- #
- # BUBBLE_SSH_PORT : SSH port, default is 1202
- #
- SCRIPT="${0}"
- SCRIPT_DIR="$(cd "$(dirname "${SCRIPT}")" && pwd)"
- . "${SCRIPT_DIR}"/bubble_common
-
- HOST="${1:?no host provided}"
- NO_RESTART=${2}
- validate_user_at_host "${HOST}"
-
- if [[ -z "${BUBBLE_SSH_PORT}" ]] ; then
- BUBBLE_SSH_PORT="1202"
- fi
-
- BUBBLE_SERVER_DIR="${SCRIPT_DIR}/../bubble-server"
- if [[ ! -d "${BUBBLE_SERVER_DIR}" ]] ; then
- die "bubble-server dir not found: ${BUBBLE_SERVER_DIR}"
- fi
- cd "${BUBBLE_SERVER_DIR}" || die "Error changing to ${BUBBLE_SERVER_DIR} directory"
-
- ANY_JAR=$(find "./target" -type f -name "bubble*.jar" | grep -v full | head -1 | wc -l | tr -d ' ')
- if [[ ${ANY_JAR} -eq 0 ]] ; then
- ANY_CHANGES=1
- else
- ANY_CHANGES=$(find "./src/main" -type f -newer "$(find "./target" -type f -name "bubble*.jar" | grep -v full | head -1)" | wc -l | tr -d ' ')
- fi
- if [[ ${ANY_CHANGES} -eq 0 ]] ; then
- echo "No changes, not repackaging jar, copying to ${HOST} ..."
- scp -P ${BUBBLE_SSH_PORT} "$(find "./target" -type f -name "bubble*.jar" | grep -v full | head -1)" ${HOST}:/tmp/bubble.jar || die "Error copying file to remote host ${HOST}"
- else
- if [[ ${ANY_JAR} -eq 0 ]] ; then
- echo "No bubble jar file found, rebuilding, then copying to ${HOST} ..."
- else
- echo "Files changed (rebuilding jar, then copying to ${HOST}) ..."
- find "./src/main" -type f -newer "$(find "./target" -type f -name "bubble*.jar" | head -1)"
- fi
- BUBBLE_PRODUCTION=1 mvn -DskipTests=true -Dcheckstyle.skip=true -Pproduction clean package || die "Error packaging jar"
- scp -P ${BUBBLE_SSH_PORT} "$(find "./target" -type f -name "bubble*.jar" | grep -v full | head -1)" ${HOST}:/tmp/bubble.jar || die "Error copying file to remote host ${HOST}"
- fi
-
- if [[ -n "${NO_RESTART}" && "${NO_RESTART}" == "norestart" ]] ; then
- echo "Patching but not restarting: ${HOST} ..."
- ssh -p ${BUBBLE_SSH_PORT} ${HOST} "cat /tmp/bubble.jar > ~bubble/api/bubble.jar"
- else
- echo "Patching and restarting: ${HOST} ..."
- ssh -p ${BUBBLE_SSH_PORT} ${HOST} "cat /tmp/bubble.jar > ~bubble/api/bubble.jar && supervisorctl restart bubble"
- fi
-
- if unzip -Z -1 ./target/bubble*.jar | grep -q "^site/$" ; then
- echo "Deploying new web: ${HOST} ..."
- ssh -p ${BUBBLE_SSH_PORT} ${HOST} "cd ~bubble && unzip -q -o /tmp/bubble.jar 'site/*' && chown -R bubble:bubble site"
- fi
|