Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Condainer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpcdf
Condainer
Commits
345bed28
Commit
345bed28
authored
1 year ago
by
Klaus Reuter
Browse files
Options
Downloads
Patches
Plain Diff
version bump to 0.1.10, introducing the cache subcommand
parent
9716421d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+30
-0
30 additions, 0 deletions
README.md
condainer/condainer.py
+14
-0
14 additions, 0 deletions
condainer/condainer.py
condainer/main.py
+3
-0
3 additions, 0 deletions
condainer/main.py
condainer/version.py
+1
-1
1 addition, 1 deletion
condainer/version.py
with
48 additions
and
1 deletion
README.md
+
30
−
0
View file @
345bed28
...
@@ -199,6 +199,36 @@ No installer is downloaded in case that variable is defined.
...
@@ -199,6 +199,36 @@ No installer is downloaded in case that variable is defined.
* Condainer environments are read-only and immutable. In case you need to add packages, rebuild the image.
* Condainer environments are read-only and immutable. In case you need to add packages, rebuild the image.
* Within the same project, when experimenting, you can toggle between multiple existing squashfs images by editing the UUID string in `
condainer.yml
`.
* Within the same project, when experimenting, you can toggle between multiple existing squashfs images by editing the UUID string in `
condainer.yml
`.
## `
cnd
` command line flags
```text
$ cnd --help
usage: cnd [-h] [-q] [-d DIRECTORY] [-y] {init,build,exec,mount,umount,prereq,status,cache,version} ...
Create and manage conda environments based on compressed squashfs images.
positional arguments:
{init,build,exec,mount,umount,prereq,status,cache,version}
init initialize directory with config files
build build containerized conda environment
exec execute command within containerized conda environment
mount mount containerized conda environment
umount unmount ("eject") containerized conda environment
prereq check if the necessary tools are installed
status print status information about the condainer
cache put condainer image into the page cache of the OS
version print version information and exit
optional arguments:
-h, --help show this help message and exit
-q, --quiet be quiet, do not write to stdout unless an error occurs
-d DIRECTORY, --directory DIRECTORY
condainer project directory, the default is the current working directory
-y, --dryrun dry run, do not actually do any operations, instead print information on what would be done
More information at https://gitlab.mpcdf.mpg.de/mpcdf/condainer
``
`
## Source Code and Contact
## Source Code and Contact
Condainer is available under the MIT license at
<https://gitlab.mpcdf.mpg.de/mpcdf/condainer>
or
<https://github.com/reuterk/condainer>
.
Condainer is available under the MIT license at
<https://gitlab.mpcdf.mpg.de/mpcdf/condainer>
or
<https://github.com/reuterk/condainer>
.
...
...
This diff is collapsed.
Click to expand it.
condainer/condainer.py
+
14
−
0
View file @
345bed28
...
@@ -552,6 +552,20 @@ def status(args):
...
@@ -552,6 +552,20 @@ def status(args):
print
(
f
"
- image mounted :
{
is_mounted
(
cfg
)
}
"
)
print
(
f
"
- image mounted :
{
is_mounted
(
cfg
)
}
"
)
def
cache
(
args
):
"""
Read squashfs image file once to motivate the OS to cache it.
"""
cfg
=
get_cfg
()
squashfs_image
=
get_image_filename
(
cfg
)
cmd
=
f
"
dd if=
{
squashfs_image
}
of=/dev/null bs=1M
"
.
split
()
if
args
.
dryrun
:
print
(
f
"
dryrun:
{
'
'
.
join
(
cmd
)
}
"
)
else
:
proc
=
subprocess
.
Popen
(
cmd
,
shell
=
False
)
proc
.
communicate
()
assert
(
proc
.
returncode
==
0
)
def
test
(
args
):
def
test
(
args
):
"""
Dummy function for quick testing
"""
Dummy function for quick testing
"""
"""
...
...
This diff is collapsed.
Click to expand it.
condainer/main.py
+
3
−
0
View file @
345bed28
...
@@ -38,6 +38,7 @@ def get_args():
...
@@ -38,6 +38,7 @@ def get_args():
subparsers
.
add_parser
(
'
umount
'
,
help
=
'
unmount (
"
eject
"
) containerized conda environment
'
)
subparsers
.
add_parser
(
'
umount
'
,
help
=
'
unmount (
"
eject
"
) containerized conda environment
'
)
subparsers
.
add_parser
(
'
prereq
'
,
help
=
'
check if the necessary tools are installed
'
)
subparsers
.
add_parser
(
'
prereq
'
,
help
=
'
check if the necessary tools are installed
'
)
subparsers
.
add_parser
(
'
status
'
,
help
=
'
print status information about the condainer
'
)
subparsers
.
add_parser
(
'
status
'
,
help
=
'
print status information about the condainer
'
)
subparsers
.
add_parser
(
'
cache
'
,
help
=
'
put condainer image into the page cache of the OS
'
)
# subparsers.add_parser('test', help=argparse.SUPPRESS)
# subparsers.add_parser('test', help=argparse.SUPPRESS)
subparsers
.
add_parser
(
'
version
'
,
help
=
'
print version information and exit
'
)
subparsers
.
add_parser
(
'
version
'
,
help
=
'
print version information and exit
'
)
...
@@ -69,5 +70,7 @@ def cli():
...
@@ -69,5 +70,7 @@ def cli():
condainer
.
test
(
args
)
condainer
.
test
(
args
)
elif
args
.
subcommand
==
'
status
'
:
elif
args
.
subcommand
==
'
status
'
:
condainer
.
status
(
args
)
condainer
.
status
(
args
)
elif
args
.
subcommand
==
'
cache
'
:
condainer
.
cache
(
args
)
elif
args
.
subcommand
==
'
version
'
:
elif
args
.
subcommand
==
'
version
'
:
print
(
version
.
get_descriptive_version_string
())
print
(
version
.
get_descriptive_version_string
())
This diff is collapsed.
Click to expand it.
condainer/version.py
+
1
−
1
View file @
345bed28
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
Single location for the version information.
Single location for the version information.
"""
"""
ver
=
(
0
,
1
,
9
)
ver
=
(
0
,
1
,
10
)
def
get_version_string
():
def
get_version_string
():
"""
Return the full version number.
"""
"""
Return the full version number.
"""
...
...
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