Skip to content
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

Merged
merged 7 commits into from
Aug 8, 2024
Merged

initial deploy #51

merged 7 commits into from
Aug 8, 2024

Conversation

srossross
Copy link
Contributor

@srossross srossross commented Aug 7, 2024

part of #41


COPY run_script.sh /usr/src/app/run_script.sh

CMD /usr/src/app/run_script.sh
Copy link
Contributor Author

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:
Copy link
Contributor Author

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

Comment on lines +1 to +20
#!/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 $@
Copy link
Contributor Author

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

Copy link
Contributor

@siddheshghadi751 siddheshghadi751 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Great!!!

@siddheshghadi751 siddheshghadi751 merged commit 7dd1589 into main Aug 8, 2024
2 checks passed
@siddheshghadi751 siddheshghadi751 deleted the deploy/init branch August 8, 2024 05:08
siddheshghadi751 added a commit that referenced this pull request Aug 8, 2024
* 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>
siddheshghadi751 added a commit that referenced this pull request Aug 9, 2024
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants