Commit 7d82b9ff authored by Stefane Fermigier's avatar Stefane Fermigier

add mynij-proxy.

parent 7afe71af
# THIS IS NOT A BUILDOUT FILE, despite purposedly using a compatible syntax.
# The only allowed lines here are (regexes):
# - "^#" comments, copied verbatim
# - "^[" section beginings, copied verbatim
# - lines containing an "=" sign which must fit in the following categorie.
# - "^\s*filename\s*=\s*path\s*$" where "path" is relative to this file
# Copied verbatim.
# - "^\s*hashtype\s*=.*" where "hashtype" is one of the values supported
# by the re-generation script.
# Re-generated.
# - other lines are copied verbatim
# Substitution (${...:...}), extension ([buildout] extends = ...) and
# section inheritance (< = ...) are NOT supported (but you should really
# not need these here).
[instance-profile]
filename = instance.cfg.in
md5sum = 4b37ff50a356dd25342075e1b6fec757
[buildout]
parts =
# monitor-base
publish-connection-parameter
mynij-proxy-promise
# Define egg directories to be the one from Software Release
# (/opt/slapgrid/...)
# Always the same.
eggs-directory = {{ buildout['eggs-directory'] }}
develop-eggs-directory = {{ buildout['develop-eggs-directory'] }}
offline = true
extends = {{ template_monitor }}
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
url = ${slap-connection:server-url}
key = ${slap-connection:key-file}
cert = ${slap-connection:cert-file}
# Create all needed directories, depending on your needs
[directory]
recipe = slapos.cookbook:mkdirectory
home = ${buildout:directory}
etc = ${:home}/etc
var = ${:home}/var
# Executables put here will be started but not monitored (for startup scripts)
script = ${:etc}/run/
# Executables put here will be started and monitored (for daemons)
service = ${:etc}/service
# Path of the log directory used by our service (see [helloweb])
log = ${:var}/log
plugins = ${:etc}/plugins
[mynij-proxy-service]
# Actual script that starts the service:
# This recipe will try to "exec" the command-line after separating parameters.
recipe = slapos.cookbook:wrapper
command-line =
{{ gunicorn_bin }} --bind [${:host}]:${:port} app:app
host = ${slap-configuration:ipv6-random}
port = 3001
wrapper-path = ${directory:service}/mynij-proxy
[mynij-proxy-promise]
<= monitor-promise-base
module = check_port_listening
name = mynij-proxy-port-listening.py
config-hostname= ${mynij-proxy-service:host}
config-port = ${mynij-proxy-service:port}
# Publish all the parameters needed for the user to connect to the instance.
# It can be anything: URL(s), password(s), or arbitrary parameters.
# Here we'll just echo back the entered name as instance parameter
[publish-connection-parameter]
recipe = slapos.cookbook:publish
<= monitor-publish
url = http://[${mynij-proxy-service:host}]:${mynij-proxy-service:port}
[buildout]
extends =
# buildout.hash.cfg is used for automated hash calculation of managed
# instance files by calling update-hash
buildout.hash.cfg
# "slapos" stack describes basic things needed for 99.9% of SlapOS Software
# Releases
../../component/git/buildout.cfg
../../stack/slapos.cfg
../../stack/monitor/buildout.cfg
# Extend here component profiles, like openssl, apache, mariadb, curl...
# Or/and extend a stack (lamp, tomcat) that does most of the work for you
# In this example we extend from helloweb component.
# ../../component/component1/buildout.cfg
# ../../component/component2/buildout.cfg
; ../../component/helloweb/buildout.cfg
parts =
# Call installation of slapos.cookbook egg defined in stack/slapos.cfg (needed
# in 99,9% of Slapos Software Releases)
slapos-cookbook
mynij-proxy-develop
mynij-proxy-eggs
instance-profile
[python]
part = python3
[jinja-template]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}
mode = 0644
[mynij-proxy-eggs]
recipe = zc.recipe.egg
eggs =
gunicorn
minij-proxy
scripts =
gunicorn
[mynij-proxy-repository]
recipe = slapos.recipe.build:gitclone
repository = https://github.com/abilian/mynij-proxy.git
branch = main
git-executable = ${git:location}/bin/git
# revision = 0b5ff71a2ede76499e81659aed392057ae910917
[mynij-proxy-develop]
recipe = zc.recipe.egg:develop
setup = ${mynij-proxy-repository:location}
# Download instance.cfg.in (buildout profile used to deployment of instance),
# replace all ${foo:bar} parameters by real values, and change $${foo:bar} to
# ${foo:bar}
# The recipe, template and mode are fetched from jijna-template
[instance-profile]
# The <= is buildout verb to use defined template
<= jinja-template
rendered = ${buildout:directory}/instance.cfg
extensions = jinja2.ext.do
context =
section buildout buildout
key mynij_proxy_location mynij-proxy-repository:location
raw gunicorn_bin ${buildout:bin-directory}/gunicorn
raw template_monitor ${monitor2-template:rendered}
[versions]
gunicorn = 20.1.0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment