Skip to content

Commit c90106d

Browse files
authored
Fix some Docker commands to use a variable instead of hard-coded 'custom' directory (#696)
* remove references to dataclass objects * Fix a copy-paste error. * remove extra file * Fix a copy-paste error. * Remove unused file * Fixes the "custom" directory to be a variable * Add variable formatting * Minor fixes
1 parent 4f139e7 commit c90106d

6 files changed

Lines changed: 13 additions & 6 deletions

File tree

custom_dc/advanced.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ To run a local instance of the services container, you need to set all of the en
131131
-e DEBUG=true \
132132
-e GOOGLE_APPLICATION_CREDENTIALS=/gcp/creds.json \
133133
-v $HOME/.config/gcloud/application_default_credentials.json:/gcp/creds.json:ro \
134-
-v $PWD/server/templates/custom_dc/custom:/workspace/server/templates/custom_dc/custom \
135-
-v $PWD/static/custom_dc/custom:/workspace/static/custom_dc/custom \
134+
-v $PWD/server/templates/custom_dc/<var>PROJECT_DIRECTORY</var>:/workspace/server/templates/custom_dc/<var>PROJECT_DIRECTORY</var> \
135+
-v $PWD/static/custom_dc/<var>PROJECT_DIRECTORY</var>:/workspace/static/custom_dc/<var>PROJECT_DIRECTORY</var> \
136136
<var>IMAGE_NAME</var>:<var>IMAGE_TAG</var></pre>
137137
<ul><li>The image name and image tag are the values you set when you <a href="build_image.md#build-package">created the package</a>.</li>
138138
<li>You don't specify any directories here, as you aren't mounting any local volumes.</li></ul><br/>

custom_dc/build_image.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,15 @@ Run the following command to build the repo (and run it locally):
156156
-e DEBUG=true \
157157
-v <var>INPUT_DIRECTORY</var>:<var>INPUT_DIRECTORY</var> \
158158
-v <var>OUTPUT_DIRECTORY</var>:<var>OUTPUT_DIRECTORY</var> \
159-
-v $PWD/server/templates/custom_dc/custom:/workspace/server/templates/custom_dc/custom \
160-
-v $PWD/static/custom_dc/custom:/workspace/static/custom_dc/custom \
159+
-v $PWD/server/templates/custom_dc/<var>PROJECT_DIRECTORY</var>:/workspace/server/templates/custom_dc/<var>PROJECT_DIRECTORY</var> \
160+
-v $PWD/static/custom_dc/<var>PROJECT_DIRECTORY</var>:/workspace/static/custom_dc/<var>PROJECT_DIRECTORY</var> \
161161
<var>IMAGE_NAME</var>:<var>IMAGE_TAG</var>
162162
</pre>
163163
</div>
164164
</div>
165165
</div>
166166

167+
- The project directory is the directory you have set up for your development environment, as described in [Set up your environment](custom_ui.md#setup) (or `custom` if you are using the default).
167168
- The image name is a meaningful name, such as `datacommons-services`.
168169
- The image tag is a meaningful description of the version you are building, such as `latest`.
169170

custom_dc/config.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Each section contains some required and optional fields, which are described in
6060

6161
## Enable subdirectories {#subdirs}
6262

63-
If you are using subdirectories, specify the file names using paths relative to the top-level directory (which you specify in the `env.list` file as the input directory), and be sure to set `"includeInputSubdirs": true` (the default is false if the option is not specified.) For example:
63+
If you are using subdirectories, specify the file names using paths relative to the top-level directory (which you specify in the `env.list` file as `INPUT_DIR`), and be sure to set `"includeInputSubdirs": true` (the default is false if the option is not specified.) For example:
6464

6565
```
6666
{
@@ -77,7 +77,7 @@ If you are using subdirectories, specify the file names using paths relative to
7777
7878
## Input files
7979

80-
The top-level `inputFiles` lists out the CSV input files and options specific to each file. The file expression is the file name (including relative subdirectories, where applicable) or wildcard patterns if the same configuration applies to multiple files.
80+
The top-level `inputFiles` lists out the CSV input files and options specific to each file. The file expression is the file name (including relative subdirectories, where applicable) or wildcard patterns if the same configuration applies to multiple files. The files and sudirectories are assumed to be relative to the directory which you have specified as `INPUT_DIR` in your `env.list` file.
8181

8282
You can use the `*` wildcard; matches are applied in the order in which they are specified in the config. For example, in the following:
8383

custom_dc/custom_data.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ my_data/
4343
├── datafile3.csv
4444
└── datafile4.csv
4545
```
46+
The top-level directory (e.g. `my_data`) can live anywhere in the file system; you will specify the full path to it when you [configure your input directory](#env). When you set up your files in Google Cloud Storage using the Terraform script, it will automatically create a top-level directory in your bucket called `input`.
47+
4648
The following sections walk you through the process of setting up your data.
4749

4850
## Prerequisite steps
@@ -420,6 +422,7 @@ The following procedures show you how to load and serve your custom data locally
420422

421423
To load data in Google Cloud, see instead [Load data in Google Cloud](/custom_dc/deploy_cloud.html) for procedures.
422424

425+
{: #env}
423426
### Configure environment variables
424427

425428
Edit the `env.list` file you created [previously](/custom_dc/quickstart.html#env-vars) as follows:

custom_dc/custom_ui.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ The Custom Data Commons image provides a default site user interface that you wi
1919

2020
This page describes how you can reuse and modify various code and configuration files that are provided for Custom Data Commons in the `website` repo.
2121

22+
> **Note**: Whenever you make changes you will need to build a custom version of the website. See [Build a local image](build_image.md#build-repo) for details.
23+
2224
{: #setup}
2325
## Before you start: Set up your environment
2426

custom_dc/deploy_cloud.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ region = "us-east1"
144144

145145
## Manage your data
146146

147+
{: #data}
147148
### Upload data files to Google Cloud Storage
148149

149150
> **Note**: Before proceeding, make sure your data is in the correct format required by Data Commons, and you've written an accompanying config file. Please see [Prepare and load your own data](custom_data.md) for complete details.

0 commit comments

Comments
 (0)