Git Product home page Git Product logo

tvm's Introduction

TVM

TVM is a tool that allows you to manage several Tutor development environments so that they work in isolation, and you can work on different projects with independent Tutor versions and configurations.

TVM is also the acronym for:

  • Tutor Version Manager: manages the version of Tutor.
  • Tutor enVironment Manager: for creating project-based environments with Tutor.

Installing TVM

Open a terminal and run:

pip install git+https://github.com/eduNEXT/tvm.git

Verify the installation:

tvm --version

Getting Started

Create and activate a new project with the following steps:

  1. Install the version of Tutor you want to use with TVM.
tvm install <tutor-version>

# For example:
# tvm install v14.0.0
  1. Create a new project with TVM.
tvm project init <project-name> <tutor-version>

# For example:
# tvm project init tvm-test v14.0.0
  1. Open the project folder.
cd <project-name>
  1. Activate the project environment.
source .tvm/bin/activate
  1. Run your project.
tutor local quickstart

You can start configuring and using your Tutor instance.

Next steps

If you want to see what else you can do, access the complete TVM documentation: https://tvm.docs.edunext.co

Getting Help

How to Contribute

Contributions are welcome! See our CONTRIBUTING file for more information โ€“ it also contains guidelines for how to maintain high code quality, which will make your contribution more likely to be accepted.

License

The code in this repository is licensed under version 3 of the AGPL unless otherwise noted. Please see the LICENSE file for details.

tvm's People

Contributors

alec4r avatar black-redoc avatar bra-i-am avatar danielsgz avatar dcoa avatar elvinquero avatar ericfab179 avatar felipemontoya avatar henrrypg avatar juandavidbuitrago avatar luisfelipec95 avatar mafermazu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tvm's Issues

[FEAT] Avoid the usage of `sudo`

Is your feature request related to a problem? Please describe.
Currently tvm adds the tutor command to your PATH by symlinking the tutor_switcher script to /usr/local/bin/tutor. This requires sudo permissions, which seems excessive, and the global tutor can cause confusion when using tutor in a virtualenv outside of tvm. I would prefer, If I were to install tvm on a virtualenv, to limit the tvm managed tutor command to the scope of that virtualenv.

Describe the solution you'd like
I think we can use the script option from setup.py to create a tutor-shim that calls the tutor switcher (essentially a shell script). This script will be added to the PATH automatically when installing the package and should fill the same role.

Describe alternatives you've considered
None

Additional context
I have not tested this, but I think it could work.

[BUG] Cant create a project with a version that is not install

Describe the bug
When run tvm project init <project_name> <version_that_isn't_install> the next error is showing

File "/home/user/Environment/test/venv/lib/python3.10/site-packages/tvm/cli.py", line 401, in init
    initialize(version)
  File "/home/user/Environment/test/venv/lib/python3.10/site-packages/tvm/environment_manager/application/tutor_project_creator.py", line 16, in __call__
    self.repository.project_creator(project_name)
  File "/home/user/Environment/test/venv/lib/python3.10/site-packages/tvm/environment_manager/infrastructure/environment_manager_git_repository.py", line 35, in project_creator
    self.create_project(project_name)
  File "/home/user/Environment/test/venv/lib/python3.10/site-packages/tvm/environment_manager/infrastructure/environment_manager_git_repository.py", line 66, in create_project
    copy_tree(tutor_version_folder, tvm_project)
  File "/home/user/Environment/test/venv/lib/python3.10/site-packages/setuptools/_distutils/dir_util.py", line 139, in copy_tree
    raise DistutilsFileError("cannot copy tree '%s': not a directory" % src)
distutils.errors.DistutilsFileError: cannot copy tree '/home/user/.tvm/v14.0.0': not a directory

To Reproduce

  1. Use v2.1.0 TVM version
  2. Run tvm project init <project_name> <version_that_isn't_install>. Be sure the tutor version is not install.

Expected behavior
You will find an error because can't initialize tutor version

[BUG] Unable to Run tvm project init

Describe the bug
I am trying to run the tvm project init command in another location after running it in one location.

I am also using virtualenv in both locations.

I encounter the following error after running the tvm project init command.

Traceback (most recent call last):
  File "/Users/uetuluk/.pyenv/versions/tutor-test-maple-tvm/bin/tvm", line 33, in <module>
    sys.exit(load_entry_point('tutor-version-manager==1.0.0', 'console_scripts', 'tvm')())
  File "/Users/uetuluk/.pyenv/versions/3.8.12/envs/tutor-test-maple-tvm/lib/python3.8/site-packages/tvm/cli.py", line 32, in main
    cli()
  File "/Users/uetuluk/.pyenv/versions/3.8.12/envs/tutor-test-maple-tvm/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Users/uetuluk/.pyenv/versions/3.8.12/envs/tutor-test-maple-tvm/lib/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/uetuluk/.pyenv/versions/3.8.12/envs/tutor-test-maple-tvm/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/uetuluk/.pyenv/versions/3.8.12/envs/tutor-test-maple-tvm/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/uetuluk/.pyenv/versions/3.8.12/envs/tutor-test-maple-tvm/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/uetuluk/.pyenv/versions/3.8.12/envs/tutor-test-maple-tvm/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/uetuluk/.pyenv/versions/3.8.12/envs/tutor-test-maple-tvm/lib/python3.8/site-packages/tvm/cli.py", line 429, in init
    if not version_is_installed(version):
  File "/Users/uetuluk/.pyenv/versions/3.8.12/envs/tutor-test-maple-tvm/lib/python3.8/site-packages/tvm/cli.py", line 79, in version_is_installed
    version_is_valid(value)
  File "/Users/uetuluk/.pyenv/versions/3.8.12/envs/tutor-test-maple-tvm/lib/python3.8/site-packages/tvm/cli.py", line 58, in version_is_valid
    result = re.match(r'^v([0-9]+)\.([0-9]+)\.([0-9]+)$', value)
  File "/Users/uetuluk/.pyenv/versions/3.8.12/lib/python3.8/re.py", line 191, in match
    return _compile(pattern, flags).match(string)
TypeError: expected string or bytes-like object

To Reproduce
Steps to reproduce the behavior:

  1. Create virtualenv A in location A

  2. Install tvm inside virtualenv A

  3. Run tvm install v13.2.2

  4. Run tvm project init
    A method

  5. Use virtualenv A in location B

  6. Run tvm project init

or B method
5. Run tvm project init again

Desktop (please complete the following information):

  • TVM Version: 1.0.0
  • Python: 3.8.12
  • Tutor: 13.2.2

Solution
I found that running tvm use v13.2.2 fixes this issue.
However, the tvm list looks like this.

v13.2.2@yEZdugrjET
v13.2.2 (active)
...

[BUG] ModuleNotFoundError: No module named 'click.shell_completion'

Describe the bug
I did a clean install from the current master,

pip install git+https://github.com/eduNEXT/tvm.git

and now if I try to call tvm it fails with:

Traceback (most recent call last):
  File "/home/fmo/.local/bin/tvm", line 5, in <module>
    from tvm.cli import main
  File "/home/fmo/.local/lib/python3.8/site-packages/tvm/cli.py", line 19, in <module>
    from click.shell_completion import CompletionItem
ModuleNotFoundError: No module named 'click.shell_completion'
fmo@bmw:~$ which tvm

To Reproduce
Steps to reproduce the behavior:

  1. pip install git+https://github.com/eduNEXT/tvm.git
  2. tvm

Expected behavior
The dependencies should be installed.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: linux mint

Distributor ID: Linuxmint
Description: Linux Mint 20.2
Release: 20.2
Codename: uma

  • TVM Version: tvm --version also fails

[FEAT] project remove

Is your feature request related to a problem? Please describe.
Every time that i delete a TVM project, i need to go to ~/.tvm and delete too.

Describe the solution you'd like
Maybe new command like tvm project remove <project-folder> that deletes project folder and it's equivalent in ~/.tvm

[BUG] tvm not install wheel

Describe the bug
When tvm is being installed is expected to install wheel as it is a requirement for it to run properlly.

To Reproduce
Steps to reproduce the behavior:

pip install git+ssh://[email protected]/eduNEXT/[email protected]

Expected behavior
When running the comman virtualenv should be installed by default without needing to pip install it

Screenshots
image

Desktop (please complete the following information):

  • OS: [e.g. Ubuntu]
    • Version [e.g. 20.04]
  • TVM Version: [e.g. v2.0.1]

Additional context
Was running on AWS EC2 Instance.

[BUG] Error running tvm list command

Describe the bug
When running tvm list the sorting function at https://github.com/eduNEXT/tvm/blob/main/tvm/cli.py#L145 fails because the local_versions are reported as v13.3.1@my-mango and this conflicts with the distutils.version.LooseVersion key.

To Reproduce
Steps to reproduce the behavior:
0. Have many installed versions of tutor.

  1. Run tvm list
  2. See error
Traceback (most recent call last):
  File "/home/fmo/.local/bin/tvm", line 8, in <module>
    sys.exit(main())
  File "/home/fmo/.local/lib/python3.10/site-packages/tvm/cli.py", line 40, in main
    cli()
  File "/home/fmo/.local/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/fmo/.local/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/fmo/.local/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/fmo/.local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/fmo/.local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/fmo/.local/lib/python3.10/site-packages/tvm/cli.py", line 156, in list_versions
    version_names = sorted(version_names, reverse=False, key=LooseVersion)
  File "/usr/lib/python3.10/distutils/version.py", line 52, in __lt__
    c = self._cmp(other)
  File "/usr/lib/python3.10/distutils/version.py", line 341, in _cmp
    if self.version < other.version:
TypeError: '<' not supported between instances of 'str' and 'int'

Expected behavior
I would expect the list of available versions to show up.

Desktop (please complete the following information):

  • OS: linux mint 21.
  • Python 3.8 and 3.10
  • TVM Version: v2.2.0

Additional context
This is the current list of installations that I have and that fail.

v14.2.2@openai
v14.0.0@tutor
v13.3.1@tvm_env
v13.3.1
v14.0.0@tvm_env
v12.2.0 (active)
v13.2.2
v14.2.2@2022_dec
v12.2.0@openai
v13.0.0@dd_tutor
v13.2.2@GqTXDukMmd
v14.0.0
v12.2.0@nau-lilac
v13.3.1@my-mango
v13.0.0
v14.0.0@tutor2

[BUG] tutor switcher does not show my config when the tvm environment is active

Describe the bug
When I run tutor --version in an active tvm environment (e.g. v13.2.2@GqTXDukMmd) it says:

You have not selected any config. Tutor will use the global default ~.local/share/tutor

Which is not true, because
tutor config printroot -> /data/tools/tvm-open/example_1

To Reproduce
Steps to reproduce the behavior:

mkdir example_1
cd example_1/
tvm project init
source .tvm/bin/activate
tutor --version
tutor config printroot

Expected behavior
It should either not say anything, or show the correct path of the TUTOR_ROOT

Desktop (please complete the following information):

  • OS:
    Distributor ID: Linuxmint
    Description: Linux Mint 20.2
    Release: 20.2
    Codename: uma

  • TVM Version: latest master

[FEAT] Nightly and Branches compatibility

Description

I would like have the option to use Tutor Nightly to create a project or install a version from a branch or commit.

How can do this currently?

I have to go to ~/.tvm and copy a valid version folder, rename it, go inside and change the branch of the tutor repository cloned.

[FEAT] add the features collected from the live session

Discussed in #27

Originally posted by felipemontoya May 25, 2022
@Alec4r I just wanted to have a place to discuss the changes we will include from the great feedback given in the live session.

We can make a task of re-watching the video to catch more things, but here is what I have from memory:

  • improve readme by having the projects explanation at the top
  • improve readme by having the project example also use a name
  • make the projects command require a directory argument
    • use the current directory as the default
    • Probably this is shared with the project name.
  • improve error message when "use V1.2.3" does not find the version because it is not installed.
  • make the default for tvm list a little larger.
  • make the coloring scheme much clear.
  • explain in a console log why we need the sudo password when it is asked when installing

Probably more things came up after I left.

[BUG] tvm project command is incomplete in README instructons

When following README's instructions there was a command missing at the second step: 2. Create a new project with tutor environment manager. The current code is: tvm project <project-name> v<tutor-version>, however, there is a command missing as it should be: tvm project **init** <project-name> v<tutor-version>.

Note the init is missing, therefore, when running the command an alert is displayed, stating the project-name is not a command. The following link goes to the mentioned section where you can find the typo: https://github.com/eduNEXT/tvm#quickstart-with-tvm-as-environment-manager

[BUG] tvm not installing vitualenv

Describe the bug
When tvm is being installed is expected to install virtualenv as it is a requirement for it to run properlly.

To Reproduce
Steps to reproduce the behavior:

  1. tvm install

Expected behavior
When running the comman virtualenv should be installed by default without needing to pip install it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.