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

Investigate: Issues setting up adamctl on Windows #98

Closed
carise opened this issue May 15, 2020 · 7 comments · Fixed by #134
Closed

Investigate: Issues setting up adamctl on Windows #98

carise opened this issue May 15, 2020 · 7 comments · Fixed by #134

Comments

@carise
Copy link
Contributor

carise commented May 15, 2020

This is when a user tries to set up adamctl without WSL (which I am guessing is the preferred way to use adamctl)

@EmmieKing
Copy link
Contributor

EmmieKing commented May 18, 2020

Kevin opened an Anaconda Prompt and installed with: “conda install -c asteroid-institute adam”

No problems

Kevin was not able to execute “adamctl login”. 'adamctl' not recognized.

We had to find the adamctl file location in order to execute the command: navigate to C:\Users\journ\Anaconda3\pkgs\adam-0.0.0.dev403+42ec1a2-py_0\python-scripts

Make sure you are using a Google account.

Initially, Kevin wanted to use but could not retrieve a token.

John created a workspace ID for this account but it will not be used.

Switched email to and was able to retrieve a token.

Carise gave me his workspace ID in our Slack channel.

Copy and Paste the token (user will not see the token in the prompt window)

The token was not accepted.

We found that .config/adam/config was not populated. Carise gave Kevin the correct format and information to paste and save into config.

envs:
prod:
token: …
url: https://pro-equinox-162418.appspot.com/_ah/api/adam/v1
workspace: …

no {} around info

no file extension when saved

/.config/adam/config

python adamctl config (to test if it worked)

Execute this command: adamctl config envs.prod.workspace "uuid-received-from-carise"

Worked!

Execute “jupyter notebook” from C:/User/Journ/Adam_home.

Navigate to ‘demos’ folder and execute ‘single_run_demo.ipynb’

Worked!

@carise
Copy link
Contributor Author

carise commented Jun 3, 2020

I'm not sure why adamctl was putting an empty json in the config file. Couldn't reproduce that issue unfortunately.

The issue about not being able to find adamctl is a real one. I think this issue might be talking about the problem, but it looks like for now, we'd have to do the workaround you did (finding the adamctl script in the installed adam package and calling it via python).

The copy-paste issue is probably an artifact of the underlying Windows command prompt. Ctrl-V by default won't copy stuff into a password-like prompt, which the Token prompt is. To get around that, set up copy-paste as per these instructions: https://stackoverflow.com/questions/52154271/how-do-i-copy-paste-in-anaconda-prompt

Then using crl-shift-v should allow pasting of the token.

Otherwise, a shorter way to get around these issues is to create file named "config" (no extension) in the user's home directory (usually: C:\Users[username]), in the path .config\adam.

The config file should contain some yaml, similar to the following:

envs:
  some_environment_name:
    token: YOUR_TOKEN_HERE
    url: ADAM_SERVER_URL
    workspace: YOUR_WORKSPACE_ID

@mjuric
Copy link
Contributor

mjuric commented Jun 4, 2020

Interesting -- we never decided if we're supporting native windows as a platform (I assumed we weren't). If we are, let's upgrade the CI to test on Windows as well. Supporting it will cause special-casing of code that depends on well-known locations in the file system (e.g. storing of config files and similar). Not sure about other differences, it's been awhile since I worked on Win.

@carise
Copy link
Contributor Author

carise commented Jun 4, 2020

Before we start writing code to address the Windows setup, I am wondering: would it be fine for us to just require that people using Windows set up WSL in order to use ADAM from Jupyter?

@EmmieKing
Copy link
Contributor

I'm not familiar with WSL. How do tokens get passed to ADAM from WSL? Do will still need the config?

@carise
Copy link
Contributor Author

carise commented Jun 4, 2020

WSL is a compatibility layer for running Linux binaries natively in Windows 10, so in theory, you would be able to run the adamctl setup instructions from the README directly without special workarounds (which we had to do for Powershell).

The token would still be pasted into the command prompt, and the config should be automatically created in whatever the home directory is under WSL.

@carise
Copy link
Contributor Author

carise commented Jan 26, 2021

Upate:

  • The issue with the {} and having to manually create a config file can be fixed by providing a default dict, {'envs': {}} when the config file path cannot be found using.
  • adamctl CLI utility not being directly accessible in Powershell. The conda recipe needs to include the console script entry point.

See #134

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 a pull request may close this issue.

3 participants