Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bitia-cli
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bitia
bitia-cli
Commits
4aca830a
Commit
4aca830a
authored
2 years ago
by
dilawar
Browse files
Options
Downloads
Patches
Plain Diff
chore: minor cleanup in the cli options.
parent
7e295492
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#3585
failed with stages
in 1 minute and 2 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+2
-1
2 additions, 1 deletion
README.md
bitia/__main__.py
+21
-9
21 additions, 9 deletions
bitia/__main__.py
bitia/__pycache__/__main__.cpython-39.pyc
+0
-0
0 additions, 0 deletions
bitia/__pycache__/__main__.cpython-39.pyc
with
23 additions
and
10 deletions
README.md
+
2
−
1
View file @
4aca830a
...
...
@@ -5,7 +5,8 @@ This is the cli utility of the BiTIA project. The other component is
Install it using pip.
```
pip install bitia
python3 -m pip install bitia
bitia --version
```
## BiTIA runner
...
...
This diff is collapsed.
Click to expand it.
bitia/__main__.py
+
21
−
9
View file @
4aca830a
...
...
@@ -6,17 +6,18 @@ bitia dir
__author__
=
"
Dilawar Singh
"
__email__
=
"
dilawar@subcom.tech
"
import
sys
import
typing
as
T
import
requests
import
zipfile
import
logging
from
rich.logging
import
RichHandler
from
pathlib
import
Path
import
tempfile
import
bitia
from
bitia.checksumdir
import
dirhash
import
logging
from
rich.logging
import
RichHandler
FORMAT
=
"
%(message)s
"
logging
.
basicConfig
(
level
=
"
NOTSET
"
,
format
=
FORMAT
,
datefmt
=
"
[%X]
"
,
handlers
=
[
RichHandler
()]
...
...
@@ -29,6 +30,11 @@ import typer
app
=
typer
.
Typer
()
def
version_callback
(
value
:
bool
):
if
value
:
print
(
bitia
.
version
())
def
bitia_dir
()
->
Path
:
"""
CLI cache directory
"""
bdir
=
Path
(
tempfile
.
gettempdir
())
/
"
bitia
"
...
...
@@ -64,7 +70,7 @@ def prepare_archive(user_dir: Path) -> Path:
assert
dinfo
[
"
files
"
],
f
"
No file found in
{
user_dir
}
"
with
zipfile
.
ZipFile
(
outfile
,
"
w
"
,
zipfile
.
ZIP_DEFLATED
)
as
zfile
:
for
entry
in
dinfo
[
"
files
"
]:
logg
ing
.
info
(
f
"
Adding
{
entry
}
to zipfile
"
)
logg
er
.
info
(
f
"
Adding
{
entry
}
to zipfile
"
)
zfile
.
write
(
entry
)
# check the prepared zip file.
...
...
@@ -93,8 +99,8 @@ def submit_job(pipeline_zip: Path, server: str):
@app.command
()
def
submit
(
user_input
,
server
:
str
=
"
https://public.bitia.link
"
):
"""
Submit your
job
.
def
submit
(
user_input
:
str
,
server
:
str
=
"
https://public.bitia.link
"
):
"""
Submit your
pipelin (url, directory, zip_file)
.
Prepare the user directory to send to the server. User can also provide link
to the pipeline to run.
...
...
@@ -108,8 +114,14 @@ def submit(user_input, server: str = "https://public.bitia.link"):
raise
RuntimeError
(
f
"
Not supported:
{
path
}
"
)
submit_job
(
pipeline_zip
,
server
)
else
:
logger
.
warning
(
f
"
Fetching pipeline from url is not supported
"
)
quit
(
-
1
)
logger
.
warning
(
"
Fetching pipeline from url is not supported
"
)
sys
.
exit
(
-
1
)
@app.command
()
def
version
()
->
str
:
"""
version information
"""
print
(
bitia
.
version
())
if
__name__
==
"
__main__
"
:
...
...
This diff is collapsed.
Click to expand it.
bitia/__pycache__/__main__.cpython-39.pyc
+
0
−
0
View file @
4aca830a
No preview for this file type
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment