-
Notifications
You must be signed in to change notification settings - Fork 2
Propose installation methods #5
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
Open
lorenyu
wants to merge
5
commits into
main
Choose a base branch
from
lorenyu/install-decision
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
28da309
Add ADR to separate infra and app templates
lorenyu e83512a
Propose installation methods
lorenyu fd632a4
Remove unused line from template
lorenyu 4c05f83
Don't copy over .gitignore when installing template
lorenyu 3942293
Merge branch 'lorenyu/install-decision' of github.com:navapbc/platfor…
lorenyu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
docs/decisions/0001-separate-infra-and-application-templates.md
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Separate infra template code and application template code into different repositories | ||
|
||
* Status: accepted | ||
* Deciders: @rocketnova @lorenyu | ||
* Date: 2022-09-08 | ||
|
||
|
||
## Context and Problem Statement | ||
|
||
We want to add support for a Python tech stack to the Platform, but want to avoid duplicating common infrastructure code. | ||
|
||
### Additional context | ||
|
||
The NJ UI project intends to develop a Python API application, which is the second application (after WIC) that will have a Python application. We expect that Python will be a common choice for future projects, and want to have a way to support it in the Platform. There is already a template-application-nextjs template that contains template infrastructure code as well as template code for the NextJS application. Creating a template-application-flask in the same manner would end up duplicating the infrastructure code. | ||
|
||
## Considered Options | ||
|
||
* Create `template-application-flask` similar to `template-application-nextjs` | ||
* Separate the infrastructure code from `template-application-nextjs` into a separate repo `template-infra`, and create `template-application-flask` with just the python application code | ||
|
||
## Decision Outcome | ||
|
||
Decision was to rename the `template-application-nextjs` repo to `template-infra` and create a new repo `template-application-nextjs` with the same git history. This effectively splits up the repo into two parts. The infra part will eventually just contain the infra code, and the other repo will just contain the application code. | ||
|
||
We also created `platform` repo to be the landing page for the platform where we can put instructions for how to use all the pieces together. | ||
|
||
### See also | ||
|
||
* [Slack thread about adding Python stack/API to the platform](https://nava.slack.com/archives/C03G1SWD9H7/p1662570596982139) | ||
* [Follow up Slack thread about naming conventions for separate repos](https://nava.slack.com/archives/C03G1SWD9H7/p1662676260639049?thread_ts=1662665280.211029&cid=C03G1SWD9H7) |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# How to use template-infra with template applications | ||
|
||
* Status: proposed | ||
* Deciders: [list everyone involved in the decision] <!-- optional --> | ||
* Date: [YYYY-MM-DD when the decision was last updated] <!-- optional --> | ||
|
||
Technical Story: User can follow instructions on how to use template-infra with either of the template applications [#2](https://github.com/navapbc/platform/issues/2) | ||
|
||
## Context and Problem Statement | ||
|
||
We previously decided to [separate infra and application templates into separate repos](./0001-separate-infra-and-application-templates.md). We need to decide how a user of the platform can use the infra template with one of the application templates or with their own custom application. | ||
|
||
## Considered Options | ||
|
||
1. User creates a repo from the template-infra repo, and replaces the `app` folder with one copied from an application template or their own. | ||
2. User copies relevant files from the template-infra repo and from the application template repo. | ||
|
||
## Decision Outcome | ||
|
||
TBD | ||
|
||
## Pros and Cons of the Options | ||
|
||
### Create project repo from template-infra repo | ||
|
||
Pros | ||
|
||
* Fewer things to copy over (github actions, pull request template) | ||
|
||
Cons | ||
|
||
* Doesn't work with existing repo (e.g. if a user already has an application and wants to add template infra to the repo) | ||
* May still need to have a setup script or instructions to remove/clean up files that aren't needed (e.g. the example application in template-infra is likely not needed) | ||
|
||
### Copy files into existing repo | ||
lorenyu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Add something like this to instructions in [template-infra](https://github.com/navapbc/template-infra) | ||
|
||
```bash | ||
# fetch latest version of template-infra | ||
git clone --single-branch --branch main --depth 1 [email protected]:navapbc/template-infra.git | ||
|
||
# copy docker-compose.yml | ||
cp template-infra/docker-compose.yml . | ||
|
||
# copy infra decision records | ||
mkdir -p docs/ | ||
cp -r template-infra/docs/decisions/ docs/decisions/ | ||
|
||
# copy infra code | ||
cp -r template-infra/infra/ infra/ | ||
|
||
# clean up template-infra folder | ||
rm -fr template-infra | ||
``` | ||
|
||
Can also simplify the middle lines into a script e.g. | ||
|
||
```bash | ||
# fetch latest version of template-infra | ||
git clone --single-branch --branch main --depth 1 [email protected]:navapbc/template-infra.git | ||
|
||
# install | ||
./template-infra/scripts/install.sh | ||
|
||
# clean up template-infra folder | ||
rm -fr template-infra | ||
``` | ||
|
||
Pros | ||
|
||
* Allows user to install template to existing repo | ||
* In some cases, potentially allows a user to update their project with new versions of the template | ||
|
||
Cons | ||
|
||
* Requires maintaining installation instructions (or script) for template-infra |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.