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

Custom rockcraft config #2011

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions rock.gunicorn.conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""gunicorn configuration."""

bind = ["0.0.0.0:8000"]
chdir = "/flask/app"
statsd_host = "localhost:9125"
worker_class = "gevent"
workers = 4
98 changes: 81 additions & 17 deletions rockcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,88 @@
name: charmhub-io
base: bare
build-base: [email protected]
version: "0.1"
title: charmhub-io
version: '0.1'
summary: Rocked charmhub.io
description: |
This is the rockcraft for the charmhub.io website.
This is the rockcraft for the charmhub.io website.
base: bare
build-base: [email protected]
platforms:
amd64:

extensions:
- flask-framework

amd64:
build-on:
- amd64
build-for:
- amd64
parts:
flask-framework/install-app:
prime:
- flask/app/.env
- flask/app/app.py
- flask/app/webapp
- flask/app/templates
- flask/app/static
- flask/app/redirects.yaml
- flask/app/security.txt
- flask/app/robots.txt
- flask/app/.env
- flask/app/app.py
- flask/app/webapp
- flask/app/templates
- flask/app/static
- flask/app/redirects.yaml
- flask/app/security.txt
- flask/app/robots.txt
- flask/app/rock.gunicorn.conf.py
plugin: dump
source: .
organize:
.env: flask/app/.env
app.py: flask/app/app.py
webapp: flask/app/webapp
templates: flask/app/templates
static: flask/app/static
redirects.yaml: flask/app/redirects.yaml
security.txt: flask/app/security.txt
robots.txt: flask/app/robots.txt
rock.gunicorn.conf.py: flask/app/rock.gunicorn.conf.py
stage:
- flask/app/.env
- flask/app/app.py
- flask/app/webapp
- flask/app/templates
- flask/app/static
- flask/app/redirects.yaml
- flask/app/security.txt
- flask/app/robots.txt
- flask/app/rock.gunicorn.conf.py
flask-framework/dependencies:
plugin: python
stage-packages:
- python3.10-venv_ensurepip
source: .
python-packages:
- gunicorn
python-requirements:
- requirements.txt
build-environment:
- PARTS_PYTHON_INTERPRETER: python3.10
flask-framework/statsd-exporter:
build-snaps:
- go
source-tag: v0.26.0
plugin: go
source: https://github.com/prometheus/statsd_exporter.git
flask-framework/runtime:
plugin: nil
override-build: mkdir -m 777 ${CRAFT_PART_INSTALL}/tmp
stage-packages:
- bash_bins
- coreutils_bins
- ca-certificates_data
run-user: _daemon_
services:
flask:
override: replace
command: /bin/python3 -m gunicorn -c /flask/app/rock.gunicorn.conf.py app:app
startup: enabled
after:
- statsd-exporter
user: _daemon_
statsd-exporter:
override: merge
command: /bin/statsd_exporter --statsd.mapping-config=/statsd-mapping.conf --statsd.listen-udp=localhost:9125
--statsd.listen-tcp=localhost:9125
summary: statsd exporter service
startup: enabled
user: _daemon_
Loading