- Web: Nginx
- App: Flask
- DB: MySQL
- NOSQL: Datastax
docker-compose up
- VSCode
- Remote Debugging: MS ptvsd
Based on best practices for Python projects with Docker Compose, presented at DockerCon-2020.
- video: Best Practices for Compose-managed Python Applications by Anca Lordache - Docker Enginner.
- repository: Demo resources for DockerCon
@server.route('/ver')
def gtest():
graph_name = 'trees_prod'
ep_graphson3 = GraphExecutionProfile(
row_factory=graph_graphson3_row_factory,
graph_options=GraphOptions(
graph_protocol=GraphProtocol.GRAPHSON_3_0,
graph_name=graph_name))
cluster = Cluster(contact_points=['172.18.0.4'], execution_profiles={'core': ep_graphson3})
session = cluster.connect()
rec = session.execute_graph("g.V().has('Sensor', 'sensor_name', '104115939').
project('name').
by('sensor_name').fold()",
execution_profile='core')
result = []
for c in rec:
result.append(c)
return flask.jsonify({"response": result})
GET /ver
Server response
{"response":[[{"name":"104115939"}]]}
Prerequisites:
- Docker
- Kind
- Tilt
- Create local registry at localhost:5000
- Create Cassandra operator v1.3
- Launch Cassandra
- Create configMap with secret password
- Apps apply configMap before running
- Check Tiltfile
# cleaning
scripts/prune.sh
# start the fun
scripts/setup.sh
scripts/setup-configMap.sh
scripts/setup-dashBoard.sh
# develop apps
tilt up
Available at: http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/
Authenticate with Token provided by following command:
kubectl -n kubernetes-dashboard describe secret admin-user-token | grep ^token