Open despiegk opened 4 years ago
@maxux What is the status of this https://github.com/threefoldtech/0-flist#pyflist ? the python binding for the flister and if we can start using it in jsx already.
Progress about flist tooling can be followed at: https://github.com/threefoldtech/0-flist/issues/13
Progression about python binding: https://github.com/threefoldtech/0-flist/issues/15
@BolaNasr found some non-working feature on zflist
, I'm fixing that first
now we have flist manipulation
j.sal.flist.new_flist()
j.sal.flist.file_copy_from_local("/sandbox/test.py","/")
j.sal.flist.commit("/sandbox/code/flist_sal.flist")
and we have builder of zflist to install zflist bin
j.builders.storage.zflist.install(reset=True)
@BolaNasr do u have a PR open, i need to take a look at the code
@muhamadazmy
to install it using kosmos
j.builders.storage.zflist.install(reset=True)
./zflist [temporary-point] open <filename>
./zflist [temporary-point] <action> <arguments>
./zflist [temporary-point] commit [optional-new-flist]
The temporary-point should be a directory where temporary files
will be used for keeping tracks of your changes.
You can also use ZFLIST_MNT environment variable to set your
temporary-point directory and not specify it on the command line.
By default, this tool will print error and information in text format,
you can get a json output by setting ZFLIST_JSON=1 environment variable.
First, you need to -open- an flist, then you can do some -edit-
and finally you can -commit- (close) your changes to a new flist.
Available actions:
open open an flist to enable editing
init initialize an empty flist to enable editing
ls list the content of a directory
find list full contents of files and directories
stat dump inode full metadata
cat print file contents (backend metadata required)
put insert local file into the flist
putdir insert local directory into the flist (recursively)
chmod change mode of a file (like chmod command)
rm remove a file (not a directory)
rmdir remove a directory (recursively)
mkdir create an empty directory (non-recursive)
metadata get or set metadata
merge merge another flist into the current one
commit commit changes to a new flist
close close mountpoint and discard files
new_flist = j.sal.flist.new()
new_flist.put("/sandbox/code/github/test.py","/")
new_flist.commit("/sandbox/code/test.flist")
#delete everything in temporary-point
new_flist.close()
new_flist = j.sal.flist.open("/tmp/test.flist")
new_flist.put_dir ("/tmp/test","/")
# list all things in flist
new_flist.list_all()
new_flist.commit("/sandbox/code/test2.flist")
#delete everything in temporary-point
new_flist.close()
Do you use the json output and the release version of zflist ?
@maxux yes i fixed in builder and now use it to return json
a sal in JSX 10 to manipulate flists
...
need to do live cycle management of apps in flist
maxim has the code done, we need to bind his C code to python to JSX