{"action":"created","comment":{"url":"https://api.github.com/repos/18F/omb-eregs/pulls/comments/165652015","pull_request_review_id":93629284,"id":165652015,"diff_hunk":"@@ -14,7 +14,8 @@ const CACHE_CONFIG = {\n \n export class Endpoint {\n   constructor(endpoint) {\n-    this.client = axios.create({ baseURL: process.env.API_URL });\n+    const baseURL = process.env.INTERNAL_API_URL || process.env.API_URL;","path":"ui/util/api/endpoints.js","position":5,"original_position":5,"commit_id":"71b58cd2aee5e02896dd3d4812a97e440740b149","original_commit_id":"71b58cd2aee5e02896dd3d4812a97e440740b149","user":{"login":"cmc333333","id":326918,"avatar_url":"https://avatars2.githubusercontent.com/u/326918?v=4","gravatar_id":"","url":"https://api.github.com/users/cmc333333","html_url":"https://github.com/cmc333333","followers_url":"https://api.github.com/users/cmc333333/followers","following_url":"https://api.github.com/users/cmc333333/following{/other_user}","gists_url":"https://api.github.com/users/cmc333333/gists{/gist_id}","starred_url":"https://api.github.com/users/cmc333333/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmc333333/subscriptions","organizations_url":"https://api.github.com/users/cmc333333/orgs","repos_url":"https://api.github.com/users/cmc333333/repos","events_url":"https://api.github.com/users/cmc333333/events{/privacy}","received_events_url":"https://api.github.com/users/cmc333333/received_events","type":"User","site_admin":false},"body":"That's a smart idea; it is rather cryptic now.","created_at":"2018-02-02T14:03:49Z","updated_at":"2018-02-02T14:03:49Z","html_url":"https://github.com/18F/omb-eregs/pull/984#discussion_r165652015","pull_request_url":"https://api.github.com/repos/18F/omb-eregs/pulls/984","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/18F/omb-eregs/pulls/comments/165652015"},"html":{"href":"https://github.com/18F/omb-eregs/pull/984#discussion_r165652015"},"pull_request":{"href":"https://api.github.com/repos/18F/omb-eregs/pulls/984"}},"in_reply_to_id":165542315},"pull_request":{"url":"https://api.github.com/repos/18F/omb-eregs/pulls/984","id":166585089,"html_url":"https://github.com/18F/omb-eregs/pull/984","diff_url":"https://github.com/18F/omb-eregs/pull/984.diff","patch_url":"https://github.com/18F/omb-eregs/pull/984.patch","issue_url":"https://api.github.com/repos/18F/omb-eregs/issues/984","number":984,"state":"open","locked":false,"title":"Attempt to make \"docker-compose up\" work, and simplify docker setup.","user":{"login":"toolness","id":124687,"avatar_url":"https://avatars2.githubusercontent.com/u/124687?v=4","gravatar_id":"","url":"https://api.github.com/users/toolness","html_url":"https://github.com/toolness","followers_url":"https://api.github.com/users/toolness/followers","following_url":"https://api.github.com/users/toolness/following{/other_user}","gists_url":"https://api.github.com/users/toolness/gists{/gist_id}","starred_url":"https://api.github.com/users/toolness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toolness/subscriptions","organizations_url":"https://api.github.com/users/toolness/orgs","repos_url":"https://api.github.com/users/toolness/repos","events_url":"https://api.github.com/users/toolness/events{/privacy}","received_events_url":"https://api.github.com/users/toolness/received_events","type":"User","site_admin":false},"body":"This simplifies our Docker setup and makes development easier in a number of ways:\r\n\r\n* `docker-compose up` now works as expected, logging the output of all containers to stdout.\r\n* There are now just 5 containers, corresponding to parts of the system architecture that are (hopefully) easy to remember:\r\n  * `persistent_db` is the Postgres database (this is unchanged from previously).\r\n  * `minio` is the mock S3 backend (also unchanged from previously).\r\n  * `api` is the Django-based API.\r\n  * `api-ui` is the NodeJS-based pipeline that's responsible for creating static assets used by the API UI (perhaps a slightly better name for this might be `admin-ui`, since it's the UI that staff/admin use).\r\n  * `ui` is the Next.js-based app that presents a user interface to the general public.\r\n* The `proxy` container is gone, and containers access each other using standard Docker networking. However, one side effect of this is that I had to add support to the Next.js app to use a different API URL depending on whether the code was executing on the server or client. I did this by adding an optional environment variable called `INTERNAL_API_URL`, which is set when developing with Docker.\r\n* Development tools relevant to each of `api`, `api-ui`, and `ui` can be accessed via `docker-compose run <container-name> <tool-cli-name> <arguments>`, e.g. `docker-compose run ui npm test`.\r\n  * Because `tool-cli-name` is just the name of the tool as it's accessed via the command-line, it's easy for developers to predict, and we don't need to create separate one-off commands every time we want to make one of the tools accessible from the Docker host.\r\n  * This also gives us easy access to commands that we hadn't exposed before, like `isort`.\r\n  * If really weird users (like me) want to, they can simply specify `bash` as the `tool-cli-name` for quick access to all the tools relevant to a particular container.\r\n  * Some development tools, particularly running `psql` and `ptw` with its list of packages, are exceptions to this general rule, but I think we can figure out better ways of accessing these in future PRs.\r\n* Rather than having separate container names for dev/prod instances of containers, we just default to dev mode, and if users want to run prod, we direct them to create a copy of the `.env.sample` file and uncomment the two lines relevant to prod mode.\r\n  * If we _really_ want dev/prod to run on different ports, as they did before, we can do that, we just have to make the user create a `docker-compose.override.yml` file instead of an `.env` file. But I was unclear on why the different modes should run on different ports, so I didn't pursue this option.\r\n* The structure of the `docker-compose.yml` file is simplified, as there are no longer any references to YAML anchors and aliases.  Aside from being (hopefully) easier to understand, it should also make it easier to [extend the compose file via conventional means](https://docs.docker.com/compose/extends/).\r\n\r\n## Disadvantages and Trade-offs\r\n\r\nThe one major disadvantage of this approach is that each container _always_ waits for its dependencies before it runs, because there's no easy way to tell what dependencies will be needed by a particular tool. This can potentially slow things down. However, in practice, it seems like the dependencies are almost always already running, so I'm hoping this shouldn't be a big deal.\r\n\r\nAlso, developers now need to type the container name in addition to the name of the dev tool they want to use.  However, I think that the trade-offs are worth it here, since we benefit in simpler docker-compose files and a larger selection of dev tools.  Furthermore, since there are identical tools available to different containers, we had to namespace the dev tools anyways (e.g. `docker-compose run api-npm` for the API UI and `docker-compose run npm` for the regular UI), which was just as bad as having to specify a container name.\r\n\r\n## To do\r\n\r\n- [x] Figure out how to make scripts accessible (e.g. `docker-compose run manage.py`)\r\n- [x] Update `README.md` to mention the new way of using scripts.\r\n- [x] Make CircleCI work.\r\n","created_at":"2018-02-01T16:24:41Z","updated_at":"2018-02-02T14:03:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1cc23035190141443e44c3eeadf381901775ec00","assignee":null,"assignees":[],"requested_reviewers":[{"login":"cmc333333","id":326918,"avatar_url":"https://avatars2.githubusercontent.com/u/326918?v=4","gravatar_id":"","url":"https://api.github.com/users/cmc333333","html_url":"https://github.com/cmc333333","followers_url":"https://api.github.com/users/cmc333333/followers","following_url":"https://api.github.com/users/cmc333333/following{/other_user}","gists_url":"https://api.github.com/users/cmc333333/gists{/gist_id}","starred_url":"https://api.github.com/users/cmc333333/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmc333333/subscriptions","organizations_url":"https://api.github.com/users/cmc333333/orgs","repos_url":"https://api.github.com/users/cmc333333/repos","events_url":"https://api.github.com/users/cmc333333/events{/privacy}","received_events_url":"https://api.github.com/users/cmc333333/received_events","type":"User","site_admin":false},{"login":"tadhg-ohiggins","id":2626258,"avatar_url":"https://avatars3.githubusercontent.com/u/2626258?v=4","gravatar_id":"","url":"https://api.github.com/users/tadhg-ohiggins","html_url":"https://github.com/tadhg-ohiggins","followers_url":"https://api.github.com/users/tadhg-ohiggins/followers","following_url":"https://api.github.com/users/tadhg-ohiggins/following{/other_user}","gists_url":"https://api.github.com/users/tadhg-ohiggins/gists{/gist_id}","starred_url":"https://api.github.com/users/tadhg-ohiggins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tadhg-ohiggins/subscriptions","organizations_url":"https://api.github.com/users/tadhg-ohiggins/orgs","repos_url":"https://api.github.com/users/tadhg-ohiggins/repos","events_url":"https://api.github.com/users/tadhg-ohiggins/events{/privacy}","received_events_url":"https://api.github.com/users/tadhg-ohiggins/received_events","type":"User","site_admin":false}],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/18F/omb-eregs/pulls/984/commits","review_comments_url":"https://api.github.com/repos/18F/omb-eregs/pulls/984/comments","review_comment_url":"https://api.github.com/repos/18F/omb-eregs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/18F/omb-eregs/issues/984/comments","statuses_url":"https://api.github.com/repos/18F/omb-eregs/statuses/71b58cd2aee5e02896dd3d4812a97e440740b149","head":{"label":"18F:docker-compose-up","ref":"docker-compose-up","sha":"71b58cd2aee5e02896dd3d4812a97e440740b149","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars0.githubusercontent.com/u/6233994?v=4","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":78458357,"name":"omb-eregs","full_name":"18F/omb-eregs","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars0.githubusercontent.com/u/6233994?v=4","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/omb-eregs","description":"A tool to find, read, and maintain White House Office of Management and Budget (OMB) policy requirements","fork":false,"url":"https://api.github.com/repos/18F/omb-eregs","forks_url":"https://api.github.com/repos/18F/omb-eregs/forks","keys_url":"https://api.github.com/repos/18F/omb-eregs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/omb-eregs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/omb-eregs/teams","hooks_url":"https://api.github.com/repos/18F/omb-eregs/hooks","issue_events_url":"https://api.github.com/repos/18F/omb-eregs/issues/events{/number}","events_url":"https://api.github.com/repos/18F/omb-eregs/events","assignees_url":"https://api.github.com/repos/18F/omb-eregs/assignees{/user}","branches_url":"https://api.github.com/repos/18F/omb-eregs/branches{/branch}","tags_url":"https://api.github.com/repos/18F/omb-eregs/tags","blobs_url":"https://api.github.com/repos/18F/omb-eregs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/omb-eregs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/omb-eregs/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/omb-eregs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/omb-eregs/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/omb-eregs/languages","stargazers_url":"https://api.github.com/repos/18F/omb-eregs/stargazers","contributors_url":"https://api.github.com/repos/18F/omb-eregs/contributors","subscribers_url":"https://api.github.com/repos/18F/omb-eregs/subscribers","subscription_url":"https://api.github.com/repos/18F/omb-eregs/subscription","commits_url":"https://api.github.com/repos/18F/omb-eregs/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/omb-eregs/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/omb-eregs/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/omb-eregs/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/omb-eregs/contents/{+path}","compare_url":"https://api.github.com/repos/18F/omb-eregs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/omb-eregs/merges","archive_url":"https://api.github.com/repos/18F/omb-eregs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/omb-eregs/downloads","issues_url":"https://api.github.com/repos/18F/omb-eregs/issues{/number}","pulls_url":"https://api.github.com/repos/18F/omb-eregs/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/omb-eregs/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/omb-eregs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/omb-eregs/labels{/name}","releases_url":"https://api.github.com/repos/18F/omb-eregs/releases{/id}","deployments_url":"https://api.github.com/repos/18F/omb-eregs/deployments","created_at":"2017-01-09T18:52:03Z","updated_at":"2017-11-16T19:18:21Z","pushed_at":"2018-02-02T01:37:41Z","git_url":"git://github.com/18F/omb-eregs.git","ssh_url":"git@github.com:18F/omb-eregs.git","clone_url":"https://github.com/18F/omb-eregs.git","svn_url":"https://github.com/18F/omb-eregs","homepage":"https://policy-beta.cio.gov/","size":3141,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":159,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":6,"open_issues":159,"watchers":7,"default_branch":"master"}},"base":{"label":"18F:master","ref":"master","sha":"640764b2ccea55bf54c89cc1d38efde11ab91bb7","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars0.githubusercontent.com/u/6233994?v=4","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":78458357,"name":"omb-eregs","full_name":"18F/omb-eregs","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars0.githubusercontent.com/u/6233994?v=4","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/omb-eregs","description":"A tool to find, read, and maintain White House Office of Management and Budget (OMB) policy requirements","fork":false,"url":"https://api.github.com/repos/18F/omb-eregs","forks_url":"https://api.github.com/repos/18F/omb-eregs/forks","keys_url":"https://api.github.com/repos/18F/omb-eregs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/omb-eregs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/omb-eregs/teams","hooks_url":"https://api.github.com/repos/18F/omb-eregs/hooks","issue_events_url":"https://api.github.com/repos/18F/omb-eregs/issues/events{/number}","events_url":"https://api.github.com/repos/18F/omb-eregs/events","assignees_url":"https://api.github.com/repos/18F/omb-eregs/assignees{/user}","branches_url":"https://api.github.com/repos/18F/omb-eregs/branches{/branch}","tags_url":"https://api.github.com/repos/18F/omb-eregs/tags","blobs_url":"https://api.github.com/repos/18F/omb-eregs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/omb-eregs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/omb-eregs/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/omb-eregs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/omb-eregs/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/omb-eregs/languages","stargazers_url":"https://api.github.com/repos/18F/omb-eregs/stargazers","contributors_url":"https://api.github.com/repos/18F/omb-eregs/contributors","subscribers_url":"https://api.github.com/repos/18F/omb-eregs/subscribers","subscription_url":"https://api.github.com/repos/18F/omb-eregs/subscription","commits_url":"https://api.github.com/repos/18F/omb-eregs/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/omb-eregs/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/omb-eregs/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/omb-eregs/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/omb-eregs/contents/{+path}","compare_url":"https://api.github.com/repos/18F/omb-eregs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/omb-eregs/merges","archive_url":"https://api.github.com/repos/18F/omb-eregs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/omb-eregs/downloads","issues_url":"https://api.github.com/repos/18F/omb-eregs/issues{/number}","pulls_url":"https://api.github.com/repos/18F/omb-eregs/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/omb-eregs/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/omb-eregs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/omb-eregs/labels{/name}","releases_url":"https://api.github.com/repos/18F/omb-eregs/releases{/id}","deployments_url":"https://api.github.com/repos/18F/omb-eregs/deployments","created_at":"2017-01-09T18:52:03Z","updated_at":"2017-11-16T19:18:21Z","pushed_at":"2018-02-02T01:37:41Z","git_url":"git://github.com/18F/omb-eregs.git","ssh_url":"git@github.com:18F/omb-eregs.git","clone_url":"https://github.com/18F/omb-eregs.git","svn_url":"https://github.com/18F/omb-eregs","homepage":"https://policy-beta.cio.gov/","size":3141,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":159,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":6,"open_issues":159,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/18F/omb-eregs/pulls/984"},"html":{"href":"https://github.com/18F/omb-eregs/pull/984"},"issue":{"href":"https://api.github.com/repos/18F/omb-eregs/issues/984"},"comments":{"href":"https://api.github.com/repos/18F/omb-eregs/issues/984/comments"},"review_comments":{"href":"https://api.github.com/repos/18F/omb-eregs/pulls/984/comments"},"review_comment":{"href":"https://api.github.com/repos/18F/omb-eregs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/18F/omb-eregs/pulls/984/commits"},"statuses":{"href":"https://api.github.com/repos/18F/omb-eregs/statuses/71b58cd2aee5e02896dd3d4812a97e440740b149"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"cmc333333"}}