Commit d3d8e665 authored by ashivani's avatar ashivani

added pipeline

parent d5cb37e8
stages:
- rails-update
- test-baseline
- submit-baseline
.aicrowd-setup: &aicrowd-setup
image: python:3.8
before_script:
- git clone https://github.com/AIcrowd/aicrowd-cli.git && cd aicrowd-cli
- pip install -r requirements.txt
- python setup.py develop
- cd ..
- aicrowd evaluations login -e "${SUPER_USER_EMAIL}" -p "${SUPER_USER_PASSWORD}"
rails-update:
stage: rails-update
image: python:3.8-slim
before_script:
- pip install pyyaml requests markdown
script:
- python utils.py
only:
changes:
- README.md
test-baseline:
stage: test-baseline
image: python:3.8
before_script:
- apt install curl
- curl -o /usr/local/bin/jq http://stedolan.github.io/jq/download/linux64/jq && chmod +x /usr/local/bin/jq
- pip install yq
- pip install jupyter
script:
- export BASELINE=`yq -r .official_baseline aicrowd.yaml | awk -F. '{print $1}'`
- jupyter nbconvert --to python baselines/${BASELINE}.ipynb
- ipython baselines/${BASELINE}.py
artifacts:
paths:
- submission.csv
only:
changes:
- baselines/*
submit-baseline:
stage: submit-baseline
<<: *aicrowd-setup
script:
- apt install curl
- curl -o /usr/local/bin/jq http://stedolan.github.io/jq/download/linux64/jq && chmod +x /usr/local/bin/jq
- pip install yq
- export CHALLENGE_NAME=`yq -r .challenge_name aicrowd.yaml`
- export EVALUATIONS_API_TOKEN=`yq -r .aicrowd_evaluations_token ~/.aicrowd/config.yaml`
- export GRADER_ID=`curl -k -X GET "https://evaluations-api.internal.k8s.aicrowd.com/v1/graders/?name=${CHALLENGE_NAME}"
-H "accept:application/json"
-H "AUTHORIZATION:${EVALUATIONS_API_TOKEN}" | jq '.[length-1].id'`
- aicrowd evaluations submission create --file ./submission.csv -g ${GRADER_ID} --wait
only:
changes:
- baselines/*
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment