-
Notifications
You must be signed in to change notification settings - Fork 0
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
initial deploy #51
initial deploy #51
Conversation
|
||
COPY run_script.sh /usr/src/app/run_script.sh | ||
|
||
CMD /usr/src/app/run_script.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simple python docker file that can only just run the score.cli
command
@@ -0,0 +1,67 @@ | |||
images: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build file to build the docker container and deploy it as a job
https://cloud.google.com/build/docs/build-config-file-schema
#!/usr/bin/env bash | ||
|
||
# The number of tasks defined in the --tasks parameter. | ||
export TOTAL_PARTITIONS="${CLOUD_RUN_TASK_COUNT}" | ||
|
||
# The index of this task. Starts at 0 for the first task and increments by 1 | ||
# for every successive task, up to the maximum number of tasks minus 1. | ||
# If you set --parallelism to greater than 1, tasks might not follow the index order. | ||
# For example, it would be possible for task 2 to start before task 1. | ||
export CURRENT_PARTITION="${CLOUD_RUN_TASK_INDEX}" | ||
|
||
|
||
echo "--- ENVIRONMENT ---" | ||
echo "OUTPUT_ROOT=${OUTPUT_ROOT}" | ||
echo "TOTAL_PARTITIONS=${TOTAL_PARTITIONS}" | ||
echo "CURRENT_PARTITION=${CURRENT_PARTITION}" | ||
echo "ARGUMENTS" $@ | ||
|
||
# TODO: execute me! | ||
echo python -m score.cli $@ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be executed with
gcloud --project=openteams-score run \
jobs execute --region=us-west1 scraper \
--tasks X \
--args /usr/src/app/run_script.sh,scrape-pypi
where --tasks X
is the total number of desired partitions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks Great!!!
* updated from main (#52) * added conda scraper (#49) * initial deploy (#51) * initial deploy * update run * typo * execute * fix * cloud build --------- Co-authored-by: Siddhesh Ghadi <30323015+siddheshghadi751@users.noreply.github.com> --------- Co-authored-by: Sean Ross-Ross <srossross@gmail.com> * Update cli.py * create scraper for vulnerabilities * Update scrape_vulnerabilities.py * Update scrape_vulnerabilities.py * Update scrape_vulnerabilities.py * Update scrape_vulnerabilities.py * Update requirements.txt * updated with severity * changed key names * Update cli.py --------- Co-authored-by: Sean Ross-Ross <srossross@gmail.com>
part of #41