Skip to content

Commit

Permalink
Milestone 2 (#33)
Browse files Browse the repository at this point in the history
* Task/3  lint modules (#11)

* Check to see if repo porting worked.

* Lint modules to find errors and resolve potential desing issues; update format to conform with PEP8 standards.

* Update GitHub pull request template to match new repo.

* Remove unnecessary module-level docstrings in modules contianing only one class.

* Change Configuration module/class/instances to ConfigManager.

* Task/5  controllers to packages (#17)

* Move controllers to packages; Move views to shared; Add template for configs

* Add Prompt util. Rename Configuration to ConfigManager; Update refs in Authenticator; Move configuration logic from ConfigManger into tapis.Auth controller

* Replace print statements with logger

* Rename password to PASSWROD in templates/core

* Change option sets in core to -v and -h

* Remove core from packages

* rename configs dir to conf

* Updaate configs to conf in Auth

* rename config to conf in Auth

* fix imports in ConfigManager

* Abstract Tapis specific settings to package level settings; Add method to Prompt; tapis.Auth now handles setting env and tenant

* Add core package for setup and package management

* Add options to yes/no prompt; Packages create and delete functionality.

* Move ConfigManager to utils

* Resolve core controllers before any other

* Move Authenticator in tapis packages

* Catch error when no command is provided

* Raise wexception when user does not provided a category

* Update core template to use tapis package by default

* Rename TapisAuthenticator to Authenticator and update old refs

* Bugfix: change old refs of self.config to self.conf

* Rename Setup controller to Cli; Remove call to old Setup controller in tapis Authenticator

* Use correct repo in the README.md (#19)

* Task/1  action filters (#21)

* Rename Controller->BaseController

* Prevent users from bypassing action filters

* Add cmd_to_class util and implement in Router

* cleanup

* tapis.Auth controller to use BaseController

* add empty settings.py to packages.core

* disallow prefixed hyphens in commands

* Add tapipy as a package and refactor

* Show error and exit if no controller is found by Router

* make all methods protected in Router except for resolve

* moved TapipyController into tapipy.packages.controllers

* Remove old references to command index

* 'index' as defaut command

* Show self.__doc__ in call to index method

* Add ACTION_FILTER_PREFIX to settings and empty before and after methods to base controller

* set_command->set_cmd

* Add before and after action filters

* Action filters implemented in tapis package

* Task/20  result error (#25)

* validate_kw_args as protected method

* move shared options and handlers into 'packages' dir

* Update BaseController to ref new location of optionsets

* str_to_cmd util

* non-tapipy packages passed formatted cmd

* Fix module loading error; handle for results that do not have a __dict__ attr

* GUI, multiple profiles, improved help command, error handling (#32)

* Use and Configure controllers

* improve help functionality on TapipyController

* improve help functionality

* Use help formatter in BaseController

* documentation update

* bugfix

* Add docker build info

* Add core.Config controller

* House configs in users root dir

* update docker file location

* Implement select functionality

* Replace old refs of self.conf to config

* add help message for request_body and query_parameters

* fix sys.exit error; remove debugs

* profile controller

* handle configuration in core.Configure controller

* Info controller; DictTable and ListItems views.

* add alias packages use command to use and use package

* Cancelable select

* remove cancel from profiles and packages

* Create generic select functionality in systems

* Call select_Action as default command when calling tapis <resource>

* Use invoke to call cmd on select

* Add env and tenant methods to use

* Add Categories controller; start aliases.

* Support category aliases; Error handling on controller method invocation.

Co-authored-by: Tyler-Clemens <[email protected]>
  • Loading branch information
nathandf and Tyler-Clemens authored Nov 29, 2021
1 parent 0764f61 commit 0fb7d6c
Show file tree
Hide file tree
Showing 60 changed files with 1,452 additions and 719 deletions.
7 changes: 7 additions & 0 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM python:3.9.9

RUN git clone https://github.com/tapis-project/tapisv3-cli/
RUN echo 'alias tapis="/tapisv3-cli/src/tapis.sh"' >> ~/.bashrc
WORKDIR /tapisv3-cli
RUN pip install -r requirements.txt
WORKDIR /tapisv3-cli/src
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Overview:

### Github Issue Links:
[Task <task#>](https://github.com/nathandf/tapis-cli/issues/<task#>)
[Task <task#>](https://github.com/tapis-project/tapisv3-cli/issues/<task#>)

### Summary of changes:
-
Expand Down
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Auth credentials
src/configs/*
!src/configs/settings.py
!src/configs/options.py
src/conf/*
!src/conf/settings.py
!src/conf/options.py
!src/conf/templates/

# Definitions for tapis entities
definitions
Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tapis-cli can be set up and run in 2 ways; Locally, and in a Docker container.

### Local setup
**Clone the repo**\
`git clone https://github.com/nathandf/tapis-cli.git`
`https://github.com/tapis-project/tapisv3-cli.git`

**Navigate to the 'src' directory of the project where tapis.sh is found**\
`cd ./tapis-cli/src`
Expand All @@ -22,11 +22,16 @@ tapis-cli can be set up and run in 2 ways; Locally, and in a Docker container.
`alias tapis="<path/to/tapis_cli_project>/src/tapis.sh"`

### Container setup
NOTE: You must have docker installed locally for this to work
`cd` into the root directory of the project

## Build the image
`docker build -f .docker/Dockerfile -t tapisv3-cli:latest .`

## Run the container interactively
docker run -it tapisv3-cli:latest bash

## Configuring Tapis CLI
Tapis CLI must first be configured. Run the following command and add your credentials\
$`tapis auth configure`

### General Usage
$`tapis [category] [command] [args]`
$`tapis configure`

9 changes: 9 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
atomicwrites==1.4.0
attrs==21.2.0
blessed==1.19.0
certifi==2020.12.5
cffi==1.14.6
charset-normalizer==2.0.4
cryptography==3.4.8
docopt==0.6.2
idna==3.2
inquirer==2.8.0
isodate==0.6.0
jsonschema==3.2.0
lazy-object-proxy==1.6.0
openapi-core==0.12.0
openapi-schema-validator==0.1.5
openapi-spec-validator==0.3.1
pipreqs==0.4.11
pycparser==2.20
PyJWT==1.7.1
pyrsistent==0.18.0
python-dateutil==2.8.2
python-editor==1.0.4
PyYAML==5.4.1
readchar==2.0.1
requests==2.26.0
six==1.16.0
strict-rfc3339==0.7
tabulate==0.8.9
tapipy==1.0.1
urllib3==1.26.6
wcwidth==0.2.5
yarg==0.1.9
25 changes: 25 additions & 0 deletions src/conf/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import os

ACTION_FILTER_SUFFIX = "_Action"

PACKAGES = [
"tapis",
"tapipy",
"jupyterscinco"
]

DEFAULT_PACKAGE = "core"

PACKAGES_DIR = "packages/"

DEFAULT_AUTH_METHOD = "PASSWORD"

AUTH_METHODS = [ "PASSWORD" ]

# The user's username and password will be saved in the file below.
CONFIG_FILE = f"{os.path.expanduser('~')}/.tapisv3-cli/conf/configs.ini"
DEFAULT_CONFIG_FILE = CONFIG_FILE

PASSWORD = "PASSWORD"
DEFAULT_AUTH_METHOD = PASSWORD

12 changes: 12 additions & 0 deletions src/conf/templates/core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
template = {
"current": {
"package": "tapis",
"profile": "",
"auth_method": "PASSWORD"
},
"profiles": {},
"package.tapis": {
"tenant": "tacc",
"env": "prod"
}
}
39 changes: 0 additions & 39 deletions src/configs/settings.py

This file was deleted.

15 changes: 0 additions & 15 deletions src/controllers/Auth.py

This file was deleted.

8 changes: 5 additions & 3 deletions src/core/AbstractView.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
from abc import ABC, abstractclassmethod


class AbstractView(ABC):

"""All abstract class methods will go here."""
@abstractclassmethod
def __init__(self, data):
pass

@abstractclassmethod
def render(self):
pass
"""Rendering code to go here."""
pass
10 changes: 10 additions & 0 deletions src/core/AuthCredential.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class AuthCredential:
def __init__(
self,
password=None,
public_key=None,
private_key=None
):
self.password = password
self.public_key = public_key
self.private_key = private_key
68 changes: 0 additions & 68 deletions src/core/Authenticator.py

This file was deleted.

Loading

0 comments on commit 0fb7d6c

Please sign in to comment.