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
10707616
Commit
10707616
authored
2 years ago
by
dilawar
Browse files
Options
Downloads
Patches
Plain Diff
feat: get the logs from container.
parent
8666917e
No related branches found
No related tags found
1 merge request
!2
version 0.2.0
Pipeline
#3724
failed with stages
in 1 minute and 41 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bitia/__main__.py
+1
-3
1 addition, 3 deletions
bitia/__main__.py
bitia/session.py
+3
-2
3 additions, 2 deletions
bitia/session.py
tests/test_sanity.py
+4
-4
4 additions, 4 deletions
tests/test_sanity.py
with
8 additions
and
9 deletions
bitia/__main__.py
+
1
−
3
View file @
10707616
...
...
@@ -72,9 +72,7 @@ def list_remote_container(
params
=
dict
(
pipeline_sha256
=
pipeline_hash
),
)
res
.
raise_for_status
()
_json
=
res
.
json
()
print
(
_json
)
return
_json
[
"
containers
"
]
return
res
.
json
()[
"
containers
"
].
split
(
"
,
"
)
@app.command
(
"
logs
"
)
...
...
This diff is collapsed.
Click to expand it.
bitia/session.py
+
3
−
2
View file @
10707616
...
...
@@ -12,8 +12,9 @@ SESSION_PICKLE_FILE = bconfig.bitia_dir() / ".session.pickle"
def
fetch_logs
(
container
:
str
,
*
,
server
):
"""
Fetch logs from a container.
"""
logger
.
info
(
f
"
Fetching logs for container `
{
container
}
`
"
)
return
g_session
.
post
(
f
"
{
server
}
/logs/?container=
{
container
}
"
,
return
get
(
f
"
{
server
}
/container/logs
"
,
params
=
dict
(
container
=
container
),
stream
=
True
,
)
...
...
This diff is collapsed.
Click to expand it.
tests/test_sanity.py
+
4
−
4
View file @
10707616
...
...
@@ -9,10 +9,10 @@ def test_sanity():
def
test_run_simple
():
output
=
bitia
.
__main__
.
run_pipeline
(
"
ls -ltr /
"
)
print
(
output
)
output
=
bitia
.
__main__
.
run_pipeline
(
"
ls -ltr /
"
,
rerun
=
True
)
print
(
output
)
for
line
in
bitia
.
__main__
.
run_pipeline
(
"
ls -ltr /
"
)
:
print
(
111
,
line
.
decode
().
rstrip
()
)
for
line
in
bitia
.
__main__
.
run_pipeline
(
"
ls -ltr /
"
,
rerun
=
True
)
:
print
(
222
,
line
.
decode
().
rstrip
()
)
if
__name__
==
"
__main__
"
:
...
...
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