Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/datacommonsorg/data into q
Browse files Browse the repository at this point in the history
  • Loading branch information
n-h-diaz committed Jan 17, 2024
2 parents b489145 + a25b514 commit 2a44a03
Show file tree
Hide file tree
Showing 28 changed files with 11,812 additions and 10,146 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Install requirements and setup a virtual environment to isolate python developme
python3 -m venv .env
source .env/bin/activate
pip3 install -r requirements.txt
pip3 install -r requirements_all.txt
```

##### Testing
Expand Down Expand Up @@ -153,8 +153,8 @@ you import modules and run tests, as below.

##### Guidelines

* Any additional package required must be specified in the requirements.txt
in the top-level folder. No other requirements.txt files are allowed.
* Any additional package required must be specified in the `requirements_all.txt`
file in the top-level folder. No other `requirements.txt` files are allowed.
* Code must be formatted according to the
[Google Python Style Guide](https://google.github.io/styleguide/pyguide.html)
according to the [yapf formatter](https://github.com/google/yapf).
Expand Down
13 changes: 6 additions & 7 deletions import-automation/executor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM gcr.io/google-appengine/python

RUN virtualenv /env -p python3.7
FROM python:3.11.4

ENV VIRTUAL_ENV /env
ENV PATH /env/bin:$PATH
RUN apt upgrade
WORKDIR /workspace

ADD requirements.txt /app/requirements.txt
RUN pip install -r /app/requirements.txt
ADD requirements.txt /workspace/requirements.txt
RUN pip install -r /workspace/requirements.txt

ADD . /app
COPY app/. /workspace/app/

CMD gunicorn --timeout 1800 --workers 5 -b :$PORT app.main:FLASK_APP
14 changes: 9 additions & 5 deletions import-automation/executor/app/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Configurations for the executor.
"""Configurations for the executor.
The app endpoints accept a configs field that allows customization of all the
configurations. See main.py.
"""

import dataclasses
import os
from typing import List
import dataclasses

from google.cloud import logging

Expand All @@ -32,6 +31,7 @@ def _production():
@dataclasses.dataclass
class ExecutorConfig:
"""Configurations for the executor."""

# ID of the Google Cloud project that hosts the executor. The project
# needs to enable App Engine and Cloud Scheduler.
gcp_project_id: str = 'google.com:datcom-data'
Expand Down Expand Up @@ -102,9 +102,13 @@ class ExecutorConfig:
# ID of the location where Cloud Scheduler is hosted.
scheduler_location: str = 'us-central1'
# Maximum time a user script can run for in seconds.
user_script_timeout: float = 600
user_script_timeout: float = 3600
# Arguments for the user script
user_script_args: List[str] = ()
# Environment variables for the user script
user_script_env: dict = None
# Maximum time venv creation can take in seconds.
venv_create_timeout: float = 600
venv_create_timeout: float = 3600
# Maximum time downloading a file can take in seconds.
file_download_timeout: float = 600
# Maximum time downloading the repo can take in seconds.
Expand Down
Loading

0 comments on commit 2a44a03

Please sign in to comment.