-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from backend-developers-ltd/init
add github actions
- Loading branch information
Showing
9 changed files
with
240 additions
and
92 deletions.
There are no files selected for viewing
This file contains 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,43 @@ | ||
name: "CD: build & push image" | ||
|
||
on: | ||
push: | ||
branches: [build-image] | ||
workflow_dispatch: | ||
|
||
env: | ||
PYTHON_DEFAULT_VERSION: "3.12" | ||
TAG_VERSION: "v0-latest" | ||
DOCKER_REPO_NAME: "backenddevelopersltd/compute-horde-prompt-gen" | ||
|
||
jobs: | ||
deploy: | ||
timeout-minutes: 15 | ||
runs-on: | ||
group: bulkier | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_DEFAULT_VERSION }} | ||
|
||
- name: Login Dockerhub | ||
run: echo "${{ secrets.DOCKERHUB_KEY }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install transformers torch | ||
- name: Docker build and push | ||
run: | | ||
df -h | ||
IMAGE_NAME="${DOCKER_REPO_NAME}:${TAG_VERSION}" | ||
cd src/compute_horde_prompt_gen | ||
python download_model.py --model_name phi3 --huggingface_token "${{ secrets.HUGGINGFACE_API_KEY }}" | ||
docker build -t $IMAGE_NAME . |
This file contains 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,45 @@ | ||
name: Run Smoke Test | ||
|
||
on: | ||
push: | ||
branches: [master, main] | ||
pull_request: | ||
branches: [master, main] | ||
workflow_dispatch: | ||
|
||
env: | ||
PYTHON_DEFAULT_VERSION: "3.11" | ||
|
||
jobs: | ||
test: | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.PYTHON_DEFAULT_VERSION }} | ||
|
||
- name: Run Test | ||
run: | | ||
cd src/compute_horde_prompt_gen | ||
python3 run.py --model_name mock --number_of_batches 5 --number_of_prompts_per_batch 20 --uuids uuid1,uuid2,uuid3,uuid4,uuid5 | ||
echo -e "\ngenerated batches:" | ||
ls | ||
ls output/ | ||
echo -e "\nchecking if prompts are generated fine" | ||
for i in $(seq 1 5); do | ||
if [ $(cat output/prompts_uuid$i.txt | wc -l) -ne 20 ]; then | ||
echo "Missing prompts: $(cat output/prompts_uuid{$i}.txt)" | ||
exit 1 | ||
fi | ||
done | ||
echo "OK" | ||
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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
Oops, something went wrong.