bug fixes & improvement #25
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
# .github/workflows/cicd.yml | ||
# - CICD (major) | ||
# - "runs on ubuntu" ye sare jobs k liye common hona --- done | ||
# - multiple connected jobs (with if successfully) --- done | ||
# - pull prod model from RDS and create container --- done | ||
# - push to ECR --- | ||
# - Run the container on EC2/ECS --- | ||
# - push docker img to docker hub and run it on docker desktop --- done | ||
# - or push particular branch k particular folder me hone pr CI pipeline trigger karo --- done | ||
name: cicd pipeline | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: # if any changes detected in below dir then runner'll trigger cicd pipeline | ||
- ./src/** | ||
- .github/** | ||
- ./prod/** | ||
- Dockerfile | ||
pull_request: | ||
branches: | ||
- main | ||
jobs: | ||
download_model: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
- name: Install AWS CLI | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y awscli | ||
- name: Configure AWS CLI | ||
run: | | ||
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws configure set region ${{ secrets.AWS_REGION }} | ||
- name: Install Utilities | ||
run: | | ||
python -m pip install --upgrade pip | ||
if [ -f model_requirements.txt ]; then pip install -r model_requirements.txt; fi | ||
- name: Fetch Model From Mlflow | ||
run: | | ||
python ./prod/mlflowdb.py ${{ secrets.TRACKING_URI }} | ||
- name: Upload Model Artifact # save the artifacts so that we can utilise it in next stage | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: model | ||
path: | | ||
/home/runner/work/cicd/cicd/model.joblib | ||
/home/runner/work/cicd/cicd/model_details.json | ||
- name: Print Current Directory # for debuging purpoer, u can remove it | ||
run: ls /home/runner/work/cicd/cicd | ||
build&push_docker_image: | ||
Check failure on line 65 in .github/workflows/cicd.yaml GitHub Actions / cicd pipelineInvalid workflow file
|
||
needs: download_model | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Print Current Directory be-down # for debug purpose | ||
run: ls /home/runner/work/cicd/cicd | ||
- name: Download Model Artifacts # download the previously saved artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: model | ||
path: /home/runner/work/cicd/cicd | ||
- name: Print Current Directory af-down # for debugging | ||
run: ls /home/runner/work/cicd/cicd | ||
- name: Build Docker Image | ||
run: | | ||
docker build -t ${{ secrets.DOCKER_USERNAME }}/wineqcicd:v1.0 . | ||
- name: Log-in to Docker Hub | ||
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Push Docker Img | ||
run: docker push ${{ secrets.DOCKER_USERNAME }}/wineqcicd:v1.0 |