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
Host URL feature. #37
Conversation
b7f6703
to
56ff9b6
Compare
Pull Request Test Coverage Report for Build 223
💛 - Coveralls |
b72c302
to
18b40a9
Compare
18b40a9
to
a95b3c7
Compare
evalai/utils/config.py
Outdated
@@ -6,10 +6,14 @@ | |||
|
|||
AUTH_TOKEN_FILE_NAME = 'token.json' | |||
|
|||
HOST_URL_FILE_NAME = 'host_url' | |||
|
|||
AUTH_TOKEN_DIR = "{}/.evalai/".format(expanduser('~')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how I missed this earlier, but this should be expanduser("~/.evalai/")
. There is no need for .format()
since there are no arguments per se.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@varunagrawal Understood. Made the changes.
a95b3c7
to
e81406c
Compare
@isht3 Please resolve conflicts here! |
e81406c
to
3461f25
Compare
@RishabhJain2018 Done! |
3461f25
to
44ef710
Compare
evalai/configure.py
Outdated
echo(e) | ||
echo(style("{} was set!".format(set_host), bold=True)) | ||
else: | ||
echo(style("Sorry, please enter a valid EvalAI host url.\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Sorry, please enter a valid url."
evalai/configure.py
Outdated
fw.write(set_host) | ||
except (OSError, IOError) as e: | ||
echo(e) | ||
echo(style("{} was set!".format(set_host), bold=True)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{} is set as the host url!
evalai/configure.py
Outdated
"Example: https://evalapi.cloudcv.org", bold=True)) | ||
else: | ||
if not os.path.exists(HOST_URL_FILE_PATH): | ||
echo(style("You haven't configured a Host URL for the CLI to use.\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"You haven't configured a Host URL for the CLI.
evalai/configure.py
Outdated
else: | ||
if not os.path.exists(HOST_URL_FILE_PATH): | ||
echo(style("You haven't configured a Host URL for the CLI to use.\n" | ||
"The CLI would be using http://localhost:8000 as the default.", bold=True)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The CLI would be using http://localhost:8000 as the default url."
evalai/configure.py
Outdated
@@ -0,0 +1,41 @@ | |||
import click |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename this file to set_host.py
44ef710
to
67bf055
Compare
@RishabhJain2018 Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@isht3 This looks good to me & works perfectly.
Left some minor comments!
.coveragerc
Outdated
@@ -11,3 +11,4 @@ exclude_lines = | |||
omit = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh..I missed this one Please add it in new PR.
@@ -9,7 +9,7 @@ | |||
from evalai.submissions import submission |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be a part of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's because API_HOST_URL doesn't exist in challenges, because I've moved it in the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay!
@@ -9,7 +9,7 @@ | |||
|
|||
from tests.data import teams_response | |||
|
|||
from evalai.utils.challenges import API_HOST_URL | |||
from evalai.utils.config import API_HOST_URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above!
67bf055
to
9035164
Compare
@RishabhJain2018 Made the changes! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
* Fix conflicts in main.py * Fix conflicts in challenges * Fix conflicts * Response message changes
evalai host
To see the current host url.evalai host --set-host <URL>
To configure URL.How to test.
Run backend on a different port, for ex, 8888
Run
evalai host -sh http://localhost:8888
To make the CLI work on this PORT.