-
Notifications
You must be signed in to change notification settings - Fork 16
Fix/148 resolution sets one commit #248
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
Oskaril-data
wants to merge
6
commits into
forecastingresearch:main
Choose a base branch
from
Oskaril-data:fix/148-resolution-sets-one-commit
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
6 commits
Select commit
Hold shift + click to select a range
b96781e
WIP: push resolution sets to git in a single commit
Oskaril-data 3b75380
fix: don't log a resolution-set push when nothing was committed
Oskaril-data 5b2f577
docs: tighten comments and docstrings for the resolution-set push
Oskaril-data 1c94e0c
Merge remote-tracking branch 'upstream/main' into fix/148-resolution-…
Oskaril-data 394bfa0
build: deploy func-push-resolution-sets via orchestration_upload.mk
Oskaril-data cc51475
fix: keep git mirror in sync on reruns and surface rejected pushes
Oskaril-data 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
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
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
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
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
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
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,37 @@ | ||
| all : | ||
| $(MAKE) clean | ||
| $(MAKE) deploy | ||
|
|
||
| .PHONY : all clean deploy | ||
|
|
||
| UPLOAD_DIR = upload | ||
| ROOT_DIR ?= $(abspath ../../..)/ | ||
| include $(ROOT_DIR)orchestration_upload.mk | ||
|
|
||
| .gcloudignore: | ||
| cp -r $(ROOT_DIR)src/helpers/.gcloudignore . | ||
|
|
||
| Dockerfile: $(ROOT_DIR)src/helpers/Dockerfile.template | ||
| sed \ | ||
| -e 's/REGION/$(CLOUD_DEPLOY_REGION)/g' \ | ||
| -e 's/STACK/google-22-full/g' \ | ||
| -e 's/PYTHON_VERSION/python312/g' \ | ||
| $< > Dockerfile | ||
|
|
||
| deploy : main.py .gcloudignore requirements.txt Dockerfile | ||
| $(stage-orchestration-upload) | ||
| gcloud run jobs deploy \ | ||
| func-push-resolution-sets \ | ||
| --project $(CLOUD_PROJECT) \ | ||
| --region $(CLOUD_DEPLOY_REGION) \ | ||
| --tasks 1 \ | ||
| --parallelism 1 \ | ||
| --task-timeout 1h \ | ||
| --memory 2Gi \ | ||
| --max-retries 0 \ | ||
| --service-account $(QUESTION_BANK_BUCKET_SERVICE_ACCOUNT) \ | ||
| --set-env-vars $(DEFAULT_CLOUD_FUNCTION_ENV_VARS) \ | ||
| --source $(UPLOAD_DIR) | ||
|
|
||
| clean : | ||
| rm -rf $(UPLOAD_DIR) .gcloudignore Dockerfile |
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,23 @@ | ||
| """Cloud Run job: push all resolution sets to the git dataset repo in a single commit. | ||
|
|
||
| See `orchestration._io.push_all_resolution_sets`. | ||
| """ | ||
|
|
||
| import logging | ||
| from typing import Any | ||
|
|
||
| from helpers import decorator | ||
| from orchestration import _io | ||
|
|
||
| logging.basicConfig(level=logging.INFO) | ||
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| @decorator.log_runtime | ||
| def driver(_: Any) -> None: | ||
| """Push all resolution sets to git in a single commit.""" | ||
| _io.push_all_resolution_sets() | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| driver(None) |
10 changes: 10 additions & 0 deletions
10
src/orchestration/func_push_resolution_sets/requirements.txt
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,10 @@ | ||
| google-cloud-storage | ||
| google-cloud-secret-manager | ||
| pandas>=2.2.2,<3.0 | ||
| GitPython | ||
| termcolor | ||
| slack_sdk | ||
| pandera | ||
| pytz | ||
| python-dateutil | ||
| backoff |
Oops, something went wrong.
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.