Skip to content
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

Merged
merged 4 commits into from Jul 10, 2018
Merged

Conversation

guyandtheworld
Copy link
Member

@guyandtheworld guyandtheworld commented Jun 17, 2018

  • 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.

@coveralls
Copy link

coveralls commented Jun 21, 2018

Pull Request Test Coverage Report for Build 223

  • 12 of 15 (80.0%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 90.625%

Changes Missing Coverage Covered Lines Changed/Added Lines %
evalai/main.py 0 1 0.0%
evalai/utils/auth.py 7 9 77.78%
Totals Coverage Status
Change from base Build 199: 0.1%
Covered Lines: 290
Relevant Lines: 320

💛 - Coveralls

@@ -6,10 +6,14 @@

AUTH_TOKEN_FILE_NAME = 'token.json'

HOST_URL_FILE_NAME = 'host_url'

AUTH_TOKEN_DIR = "{}/.evalai/".format(expanduser('~'))
Copy link
Contributor

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.

Copy link
Member Author

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.

@RishabhJain2018
Copy link
Member

@isht3 Please resolve conflicts here!

@RishabhJain2018 RishabhJain2018 moved this from Under Review to In Progress in EvalAI-CLI GSoC Deliverables Jul 6, 2018
@guyandtheworld
Copy link
Member Author

@RishabhJain2018 Done!

echo(e)
echo(style("{} was set!".format(set_host), bold=True))
else:
echo(style("Sorry, please enter a valid EvalAI host url.\n"
Copy link
Member

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."

fw.write(set_host)
except (OSError, IOError) as e:
echo(e)
echo(style("{} was set!".format(set_host), bold=True))
Copy link
Member

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!

"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"
Copy link
Member

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.

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))
Copy link
Member

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."

@@ -0,0 +1,41 @@
import click
Copy link
Member

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

@guyandtheworld
Copy link
Member Author

@RishabhJain2018 Done!

Copy link
Member

@RishabhJain2018 RishabhJain2018 left a 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 =
Copy link
Member

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
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above!

@guyandtheworld
Copy link
Member Author

@RishabhJain2018 Made the changes!

Copy link
Member

@RishabhJain2018 RishabhJain2018 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@RishabhJain2018 RishabhJain2018 merged commit 5e4e811 into Cloud-CV:master Jul 10, 2018
@RishabhJain2018 RishabhJain2018 removed this from In Progress in EvalAI-CLI GSoC Deliverables Jul 19, 2018
Ram81 pushed a commit to Ram81/evalai-cli that referenced this pull request Nov 9, 2020
* Fix conflicts in main.py

* Fix conflicts in challenges

* Fix conflicts

* Response message changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants