-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable local deployment to improve development and testing (#484)
## Overview The Birdhouse stack can now be deployed locally and accessed on a browser on the host machine without the need for an SSL certificate. This is useful for local development and for running tests against the full stack while developing and in CI environments. To enable this, add the new `optional-components/local-dev-test` component to `BIRDHOUSE_EXTRA_CONF_DIRS` and set the following environment variables in the local environment file: * `export BIRDHOUSE_FQDN=host.docker.internal` * `export BIRDHOUSE_HTTP_ONLY=True` You should also add ``host.docker.internal`` to your ``/etc/hosts`` file pointing to the loopback address so that URLs generated by Birdhouse that refer to ``host.docker.internal`` will resolve properly in a browser: ``` echo '127.0.0.1 host.docker.internal' | sudo tee -a /etc/hosts ``` After deploying the stack, you can now interact with the Birdhouse software at ``http://host.docker.internal`` from the machine that is the docker host. In order to implement the changes above, the following non-breaking changes have been made to the deployment code: - added a configuration variable `BIRDHOUSE_HTTP_ONLY` which is not set by default. If set to `True` the `proxy` component will only serve content over `http` (not `https`). - added the following configuration variables. These should not be set directly unless you really know what you're doing: - `BIRDHOUSE_PROXY_SCHEME`: default is `http` if `BIRDHOUSE_HTTP_ONLY` is `True`, otherwise `https` - `PROXY_INCLUDE_HTTPS`: default is unset if `BIRDHOUSE_HTTP_ONLY` is `True`, otherwise `include /etc/nginx/conf.d/https.include;` - changed the default values for the following configuration variables: - `BIRDHOUSE_ALLOW_UNSECURE_HTTP`: default is now `True` if `BIRDHOUSE_HTTP_ONLY` is `True` - logs are written to stderr by default. Previously they were written to stdout. - this allows us to call scripts and programmatically use their outputs. Previously log entries would need to be manually filtered out before program outputs could be used. - added the `--log-stdout` and `--log-file` flags to the `bin/birdhouse` interface to allow redirecting logs to stdout or to a specific file instead. - log redirection can also now be set using environment variables: - `BIRDHOUSE_LOG_FD` can be used to redirect logs to a file descriptor (ex: `BIRDHOUSE_LOG_FD=3`) - `BIRDHOUSE_LOG_FILE` can be used to redirect logs to file (ex: `BIRDHOUSE_LOG_FILE=/some/file/on/disk.log`) - Note that the variables here should not be set in the local environment file since that file is sourced **after** some logs are written. Instead, set these by exporting them in the parent process that calls `bin/birdhouse`. - for backwards compatibility, if scripts are not called through the `bin/birdhouse` interface, logs will still be written to stdout. ## Changes **Non-breaking changes** - allows users to run the stack locally without the need for an ssl certificate - logs are now written to stderr when called through the `bin/birdhouse` interface - new flags for `bin/birdhouse` and environment variables to set logging options **Breaking changes** - If you have an external script or component that you want to run with a locally deployed stack that contains a URL with a hardcoded scheme set to `https`, this may need to be changed to use the `BIRDHOUSE_PROXY_SCHEME` environment variables instead (replace `https` with `${BIRDHOUSE_PROXY_SCHEME}`) ## Related Issue / Discussion - see a previous (failed) attempt at this in #361 - Further discussion: - Where else should we document this? Maybe in `CONTRIBUTING.rst`? - Should we also be adding some sort of `start-local` option to the Makefile? ## Additional Information This change is necessary if we are serious about improving the testing infrastructure for this stack. ## CI Operations <!-- The test suite can be run using a different DACCS config with ``birdhouse_daccs_configs_branch: branch_name`` in the PR description. To globally skip the test suite regardless of the commit message use ``birdhouse_skip_ci`` set to ``true`` in the PR description. Using ``[<cmd>]`` (with the brackets) where ``<cmd> = skip ci`` in the commit message will override ``birdhouse_skip_ci`` from the PR description. Such commit command can be used to override the PR description behavior for a specific commit update. However, a commit message cannot 'force run' a PR which the description turns off the CI. To run the CI, the PR should instead be updated with a ``true`` value, and a running message can be posted in following PR comments to trigger tests once again. --> birdhouse_daccs_configs_branch: master birdhouse_skip_ci: false
- Loading branch information
Showing
99 changed files
with
589 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,4 @@ venv/ | |
## Testing | ||
.pytest_cache/ | ||
*.log | ||
birdhouse/data/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.6.5 2024-12-18T18:55:30Z | ||
2.7.0 2024-12-19T13:52:44Z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.