summaryrefslogtreecommitdiff
path: root/topics/deploy
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-09-11 03:38:54 -0500
committerFrederick Muriuki Muriithi2024-09-11 03:38:54 -0500
commit44b7c8b1dcb4396237e685d37c339ac016dc5cc0 (patch)
tree301f808fe740071661b27c26ad1ba8f10703461a /topics/deploy
parente29de8dd15aa8f6a542e9dbde8f8458d80ede3cc (diff)
downloadgn-gemtext-44b7c8b1dcb4396237e685d37c339ac016dc5cc0.tar.gz
Add note on paths for deployment.
Diffstat (limited to 'topics/deploy')
-rw-r--r--topics/deploy/paths-in-flask-applications.gmi22
1 files changed, 22 insertions, 0 deletions
diff --git a/topics/deploy/paths-in-flask-applications.gmi b/topics/deploy/paths-in-flask-applications.gmi
new file mode 100644
index 0000000..77bc201
--- /dev/null
+++ b/topics/deploy/paths-in-flask-applications.gmi
@@ -0,0 +1,22 @@
+# Paths in Flask Application
+
+## Tags
+
+* type: doc, docs, documentation
+* assigned: fredm
+* keywords: application paths, flask, absolute path, relative path
+
+## Content
+
+Always build and use absolute paths for the resources you use in your application. Assuming that the application will always be run with the root of the application's repository/package as the working directory is a recipe for failure.
+
+To demonstrate, see the following issue:
+=> /issues/genenetwork2/haley-knott-regression-mapping-error
+
+In this case, the path issue was not caught in the CI/CD environment since it runs the application with the repository root as its working directory. This issue will also not show up in most development environments since it is easier to run the application from the root of the repository than have to set up the PYTHONPATH variables.
+
+In the new containers making use of the "(genenetwork services genenetwork)" module in gn-machines[fn:1], the working directory where the application is invoked has no relation with the application's package — in fact, the working directory is actually the root of the containers file system ("/").
+
+# Footnotes
+
+[fn:1] https://git.genenetwork.org/gn-machines/