-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Metadata commands & single file download (#115)
* Initial changes for cmf commands conversion to function * cmf_commands * updating artifact pull commands * Updated * Initial commint for single file download * code for single artifact download * removed unnecessary comments * removing unneccesary comments * Fixed a small error * Resolved an error in minio artifact pull * Resolved a small issue creating problem in artifact pull for ssh remote * cmf init commands created outside cmf.py * Update cmf_client.md Updated the cmf_client * adding cmf init as helper functions * changes in test_push and pull * adding jupyter notebook feature * modifying jupyter notebook * improving naming, commenting,folder structure * Update Readme.md --------- Co-authored-by: Abhinav Chobey <chobey@abhinav-cmf-hpe.labs.hpecorp.net> Co-authored-by: abhinavchobey <111754147+abhinavchobey@users.noreply.github.com>
- Loading branch information
1 parent
3cde65b
commit abdeac6
Showing
11 changed files
with
1,513 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,216 @@ | ||
from cmflib import cli | ||
|
||
|
||
def _metadata_push(pipeline_name, file_name, execution_id): | ||
cli_args = cli.parse_args( | ||
[ | ||
"metadata", | ||
"push", | ||
"-p", | ||
pipeline_name, | ||
"-f", | ||
file_name, | ||
"-e", | ||
execution_id | ||
] | ||
) | ||
cmd = cli_args.func(cli_args) | ||
msg = cmd.do_run() | ||
print(msg) | ||
return msg | ||
|
||
def _metadata_pull(pipeline_name, file_name, execution_id): | ||
cli_args = cli.parse_args( | ||
[ | ||
"metadata", | ||
"pull", | ||
"-p", | ||
pipeline_name, | ||
"-f", | ||
file_name, | ||
"-e", | ||
execution_id | ||
] | ||
) | ||
cmd = cli_args.func(cli_args) | ||
msg = cmd.do_run() | ||
print(msg) | ||
return msg | ||
|
||
def _artifact_push(): | ||
cli_args = cli.parse_args( | ||
[ | ||
"artifact", | ||
"push", | ||
|
||
] | ||
) | ||
cmd = cli_args.func(cli_args) | ||
msg = cmd.do_run() | ||
print(msg) | ||
return msg | ||
|
||
|
||
def _artifact_pull(pipeline_name, file_name): | ||
|
||
cli_args = cli.parse_args( | ||
[ | ||
"artifact", | ||
"pull", | ||
"-p", | ||
pipeline_name, | ||
"-f", | ||
file_name, | ||
|
||
] | ||
) | ||
cmd = cli_args.func(cli_args) | ||
msg = cmd.do_run() | ||
print(msg) | ||
return msg | ||
|
||
def _artifact_pull_single(pipeline_name, file_name,artifact_name): | ||
print("inside_cmf_cmd_wrapper") | ||
cli_args = cli.parse_args( | ||
[ | ||
"artifact", | ||
"pull", | ||
"-p", | ||
pipeline_name, | ||
"-f", | ||
file_name, | ||
"-a", | ||
artifact_name, | ||
|
||
] | ||
) | ||
cmd = cli_args.func(cli_args) | ||
msg = cmd.do_run() | ||
print(msg) | ||
return msg | ||
|
||
|
||
def _cmf_cmd_init(): | ||
cli_args = cli.parse_args( | ||
[ | ||
"init", | ||
"show" | ||
] | ||
) | ||
cmd = cli_args.func(cli_args) | ||
msg = cmd.do_run() | ||
print(msg) | ||
return msg | ||
|
||
def _init_local(path,git_remote_url,cmf_server_url,neo4j_user,neo4j_password,neo4j_uri): | ||
cli_args = cli.parse_args( | ||
[ | ||
"init", | ||
"local", | ||
"--path", | ||
path, | ||
"--git-remote-url", | ||
git_remote_url, | ||
"--cmf-server-url", | ||
cmf_server_url, | ||
"--neo4j-user", | ||
neo4j_user, | ||
"--neo4j-password", | ||
neo4j_password, | ||
"--neo4j-uri", | ||
neo4j_uri | ||
] | ||
) | ||
cmd = cli_args.func(cli_args) | ||
msg = cmd.do_run() | ||
print(msg) | ||
return msg | ||
|
||
|
||
def _init_minioS3(url,endpoint_url,access_key_id,secret_key,git_remote_url,cmf_server_url,neo4j_user,neo4j_password,neo4j_uri): | ||
cli_args = cli.parse_args( | ||
[ | ||
"init", | ||
"minioS3", | ||
"--url", | ||
url , | ||
"--endpoint-url", | ||
endpoint_url, | ||
"--access-key-id", | ||
access_key_id, | ||
"--secret-key", | ||
secret_key, | ||
"--git-remote-url", | ||
git_remote_url, | ||
"--cmf-server-url", | ||
cmf_server_url, | ||
"--neo4j-user", | ||
neo4j_user, | ||
"--neo4j-password", | ||
neo4j_password, | ||
"--neo4j-uri", | ||
neo4j_uri | ||
] | ||
) | ||
cmd = cli_args.func(cli_args) | ||
msg = cmd.do_run() | ||
print(msg) | ||
return msg | ||
|
||
def _init_amazonS3(url,access_key_id,secret_key,git_remote_url,cmf_server_url,neo4j_user,neo4j_password,neo4j_uri): | ||
cli_args = cli.parse_args( | ||
[ | ||
"init", | ||
"amazonS3", | ||
"--url", | ||
url , | ||
"--access-key-id", | ||
access_key_id, | ||
"--secret-key", | ||
secret_key, | ||
"--git-remote-url", | ||
git_remote_url, | ||
"--cmf-server-url", | ||
cmf_server_url, | ||
"--neo4j-user", | ||
neo4j_user, | ||
"--neo4j-password", | ||
neo4j_password, | ||
"--neo4j-uri", | ||
neo4j_uri | ||
] | ||
) | ||
cmd = cli_args.func(cli_args) | ||
msg = cmd.do_run() | ||
print(msg) | ||
return msg | ||
|
||
def _init_sshremote(path,user,port,password,git_remote_url,cmf_server_url,neo4j_user,neo4j_password,neo4j_uri): | ||
cli_args = cli.parse_args( | ||
[ | ||
"init", | ||
"sshremote", | ||
"--path", | ||
path, | ||
"--user", | ||
user , | ||
"--port", | ||
port, | ||
"--password", | ||
password, | ||
"--git-remote-url", | ||
git_remote_url, | ||
"--cmf-server-url", | ||
cmf_server_url, | ||
"--neo4j-user", | ||
neo4j_user, | ||
"--neo4j-password", | ||
neo4j_password, | ||
"--neo4j-uri", | ||
neo4j_uri | ||
] | ||
) | ||
cmd = cli_args.func(cli_args) | ||
msg = cmd.do_run() | ||
print(msg) | ||
return msg |
Oops, something went wrong.