Commit 83297cac authored by ashivani's avatar ashivani

"added pipeline"

parent e56858c7
stages:
- rails-update
- test-baseline
- submit-baseline
- rails-update
.aicrowd-setup: &aicrowd-setup
image: python:3.8
......@@ -11,6 +11,17 @@ stages:
- 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
......@@ -48,13 +59,3 @@ submit-baseline:
changes:
- baselines/*
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
---
challenge_name: wineq
evaluation_repo: git@gitlab.aicrowd.com:aicrowd/practice-challenges/aicrowd_WINEQ_challenge_evaluator.git
data_url: https://s3.wasabisys.com/aicrowd-practice-challenges/public/wineq/v0.1/test_ground_truth.csv
......
......@@ -12,6 +12,7 @@ class Utils():
with open("aicrowd.yaml", "r") as f:
self.challenge = yaml.safe_load(f)['challenge_name']
print(self.challenge)
with open("README.md", "r") as f:
self.content = f.read()
......@@ -25,7 +26,7 @@ class Utils():
def create_challenge(self):
payload = {
"challenge": self.challenge,
"challenge": self.challenge.upper(),
"status_cd": "draft",
"tagline": "",
"perpetual_challenge": False,
......@@ -44,7 +45,7 @@ class Utils():
"subissions_page": True,
"license": "",
"dataset_description": None,
"image_file": {"url": "/images/"+self.challenge},
"image_file": {"url": f"https://gitlab.aicrowd.com/aicrowd/practice-challenges/aicrowd_{self.challenge.upper()}_challenge/{self.challenge.upper()}.jpg"},
"show_leaderboard": True,
"grader_identifier": "AIcrowd_GRADER_POOL",
"online_submissions": True,
......@@ -60,7 +61,7 @@ class Utils():
"teams_allowed": True,
"max_team_participants": 5,
"team_freeze_seconds_before_end": 604800,
"hidden_challenge": True,
"hidden_challenge": False,
"team_freeze_time": None,
"score_title": "",
"score_secondary_title": "",
......@@ -71,29 +72,29 @@ class Utils():
"dataset_files_attributes": [
{
"seq": 1,
"title": "Training Data",
"description": "Data to be used for training",
"title": "train.csv",
"description": "File that should be used for training. It contains the data with their respective labels",
"evaluation": False,
"visible": True,
"hosting_location": "External",
"external_url": f"https://s3.eu-central-1.wasabisys.com/aicrowd-practice-challenges/public/"+self.challenge+"/v0.1/train.csv",
"external_url": f"https://s3.eu-central-1.wasabisys.com/aicrowd-practice-challenges/public/{self.challenge}/v0.1/train.csv",
"external_file_size": ""
},
{
"seq": 2,
"title": "Validation Data",
"description": "Data to be used for validation",
"title": "test.csv",
"description": "File that should be used for testing. It does not contains the labels",
"evaluation": False,
"visible": True,
"hosting_location": "External",
"external_url": f"https://s3.eu-central-1.wasabisys.com/aicrowd-practice-challenges/public/"+self.challenge+"/v0.1/test.csv",
"external_url": f"https://s3.eu-central-1.wasabisys.com/aicrowd-practice-challenges/public/{self.challenge}/v0.1/test.csv",
"external_file_size": ""
},
]
}
return requests.post(self.base_url, json=payload, headers=self.headers)
return requests.post(self.base_url, json=payload, headers=self.headers)
def update_challenge(self):
payload = {"description": self.content}
......@@ -104,12 +105,11 @@ class Utils():
response = self.update_challenge()
if response.status_code == 404:
response = self.create_challenge()
print(response.text)
return response
if __name__ == "__main__":
utils = Utils()
print(utils.update_or_create())
print(utils.update_or_create().text)
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