Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AsciiNema improvements #2742

Closed
5 tasks
markus2330 opened this issue Jun 2, 2019 · 29 comments
Closed
5 tasks

AsciiNema improvements #2742

markus2330 opened this issue Jun 2, 2019 · 29 comments

Comments

@markus2330
Copy link
Contributor

  • should work as-is also in docker (sudo?)
  • kdb editor also for hosts
  • also show from other language, e.g. python
  • show YAML
  • show spec-mount
@markus2330 markus2330 assigned ghost Nov 25, 2019
This was referenced Nov 25, 2019
@ghost
Copy link

ghost commented Nov 28, 2019

I can rerecord everything as it is now to show the error message since it minorly belongs under "my domain" but I do not want to completely instruct a whole yaml, python, specmount example as this is a lot of work to sensefully show a user what elektra can do.

We agreed that only error message related issues belong to me...

@markus2330
Copy link
Contributor Author

I agree that python is not something you worked with. YAML is just an example, not really important. The other things are perfectly in scope.

@ghost
Copy link

ghost commented Nov 28, 2019

Ok, but what about "should work as-is also in docker"
I do not understand this point.

@markus2330
Copy link
Contributor Author

Ok, but what about "should work as-is also in docker"
I do not understand this point.

That the tutorial is done inside of docker. So you start the tutorial by pulling a docker image (maybe you can push an alpine Docker image to docker.com which has Elektra 0.9.1 installed so that you do not need to install during the tutorial).

@ghost
Copy link

ghost commented Nov 28, 2019

Why would I need to do that in a docker container? I have asciinema local on my system and record it there. All that asciinema emits is a .json file

@markus2330
Copy link
Contributor Author

Why would I need to do that in a docker container? I have asciinema local on my system and record it there.

As first command during the tutorial you pull and enter the docker container. This has the advantage that what is recorded also works for people who want to try out themselves without the need to go through installation.

@ghost
Copy link

ghost commented Nov 28, 2019

maybe you can push an alpine Docker image to docker.com which has Elektra 0.9.1 installed so that you do not need to install during the tutorial

Don't we have a docker registry already were jenkins pulls all the containers? If I would push such a docker image to dockerhub then I probably need your account for that so the docker image stays online for the lifetime of elektra.

@markus2330
Copy link
Contributor Author

This should be no problem but can you create a Docker image?

@mpranj did you plan to do such an image for releases?

@mpranj
Copy link
Member

mpranj commented Nov 28, 2019

did you plan to do such an image for releases?

No immediate plans, but sounds like nice to have. I like the idea very much that we publish such an image officially with each release. Elektra is quite a pain to compile and set up for novices.

@ghost
Copy link

ghost commented Nov 28, 2019

Ok, can you create an alpine docker image and upload it to a (newly created public?) repo? It would make most sense that you as build master do that :)

@mpranj
Copy link
Member

mpranj commented Nov 28, 2019

can you create an alpine docker image

I can create it but probably not today.

@mpranj
Copy link
Member

mpranj commented Nov 28, 2019

No immediate plans

probably not today.

Ok, so I created it today.

docker run -it elektra/elektra and you are dropped into a shell with kdb available.

@markus2330
Copy link
Contributor Author

Amazing job! Do not forget to advertise it in the next release notes. We should also add this information to the important places for newcomers (@d3nwp).

@ghost
Copy link

ghost commented Nov 30, 2019

@mpranj Which plugins did you include in the image? json for example does not exist. If I should include yaml you probably should install one of that.

Btw is sudo not installed in the image but required to mount (actually very weird).

Furthermore: this image is whopping 700 mb big, did you take an alpine version?

@markus2330
Copy link
Contributor Author

Btw is sudo not installed in the image but required to mount (actually very weird).

The image is constructed in a way that you do not need sudo. So simply type as first command (after docker run):

alias sudo= # in this image we do not need to be root

Then "sudo" will not happen in the image but if users try it out on their machine, they will have all the commands that need sudo with sudo.

@mpranj
Copy link
Member

mpranj commented Nov 30, 2019

@Piankero you can inspect the image in #3300 and add suggestions.
Unfortunately:

677.1M	/usr
360.8M	/usr/local/lib/elektra
73.4M	/usr/libexec/gcc
63.1M	/usr/local/bin/kdb

I think actually the image is not constructed such that sudo is not needed, I need to improve that. Or did you try it out?

@ghost
Copy link

ghost commented Nov 30, 2019

The image is constructed in a way that you do not need sudo.

docker run -it elektra/elektra           
~ $ kdb mount hello.js /hello ini
 Sorry, 3 warnings were issued ;(
	Sorry, module resolver_fm_hpu_b issued the warning C01100:
	Resource: Could not create configuration file '/etc/kdb/elektra.ecf'. Reason: No such file or directory
	Mountpoint: system/elektra
	Configfile: /etc/kdb/elektra.ecf.8:1575114514.708002.tmp
	At: /opt/elektra/src/plugins/resolver/resolver.c:709
	Sorry, module dump issued the warning C01100:
	Resource: Could not open file /etc/kdb/elektra.ecf.8:1575114514.708002.tmp for writing. Reason: No such file or directory
	Mountpoint: system/elektra
	Configfile: /etc/kdb/elektra.ecf.8:1575114514.708002.tmp
	At: /opt/elektra/src/plugins/dump/dump.cpp:287
	Sorry, module resolver_fm_hpu_b issued the warning C01100:
	Resource: Could not unlink the file '/etc/kdb/elektra.ecf.8:1575114514.708002.tmp'. Reason: No such file or directory
	Mountpoint: system/elektra
	Configfile: /etc/kdb/elektra.ecf.8:1575114514.708002.tmp
	At: /opt/elektra/src/plugins/resolver/resolver.c:1154
Sorry, module resolver_fm_hpu_b issued the error C01100:
Resource: Could not create directory '/etc/kdb'. Reason: Permission denied. Identity: uid: 1000, euid: 1000, gid: 1000, egid: 1000
Mountpoint: system/elektra
Configfile: /etc/kdb/elektra.ecf.8:1575114514.708002.tmp
At: /opt/elektra/src/plugins/resolver/resolver.c:785


IMPORTANT: Sorry, I am unable to write your requested mountpoint to system/elektra/mountpoints.
           You can get the problematic file name by reading the elektra system file (kdb file system/elektra/mountpoints).
           Usually you need to be root for this operation (try `sudo !!`).

@mpranj
Copy link
Member

mpranj commented Nov 30, 2019

@Piankero yes, it is configured incorrectly. Sorry, I'll try to fix it soon!

@mpranj
Copy link
Member

mpranj commented Nov 30, 2019

I tried to simply configure elektra to not write anything outside the user directory, but the tutorial includes things like editing the hosts file as root.

Maybe it makes sense that the image is run as root so these things can be done easily?
Otherwise sudo needs to be set up in the image properly, I don't know if that makes sense.

EDIT: ping also does not work in alpine / busybox without root.

EDIT: another thing that is not available in alpine to my knowledge is xerces, so there is no xmltool :(

EDIT: elektrify-getenv does not work because alpine does not use glibc.

@mpranj
Copy link
Member

mpranj commented Nov 30, 2019

I pushed elektra/elektra:0.9.1-3 which configures kdb to write only in the user homedir.

Since not everything from the AsciiNema tutorial will work on alpine, I'm open for other suggestions.

@markus2330
Copy link
Contributor Author

I tried to simply configure elektra to not write anything outside the user directory, but the tutorial includes things like editing the hosts file as root.

Yes.

Maybe it makes sense that the image is run as root so these things can be done easily?
Otherwise sudo needs to be set up in the image properly, I don't know if that makes sense.

Maybe sudo is better, as all our tutorials use sudo.

e.g. scripts/docker/cirrus/arch/Dockerfile has sudo

EDIT: ping also does not work in alpine / busybox without root.

Not a big deal to not have it (as we also do not have getenv)

EDIT: another thing that is not available in alpine to my knowledge is xerces, so there is no xmltool :(

Not a big deal: then we do not show the xerces plugin. xmltool is deprecated anyway.

EDIT: elektrify-getenv does not work because alpine does not use glibc.

This part we can remove.

@mpranj
Copy link
Member

mpranj commented Nov 30, 2019

Thank you! I will add sudo then!

@mpranj
Copy link
Member

mpranj commented Nov 30, 2019

I pushed elektra/elektra:0.9.1-5 which adds sudo and reduces image size by factor ~100.

@ghost
Copy link

ghost commented Dec 2, 2019

@markus2330 Before I record the new tutorial I want you to approve the whole playbook.

Here is the new version:

docker run -it elektra/elektra                                      > NEW LINE

sudo kdb mount hello.js /hello json
kdb set user/hello/hello/world "Hello World"
kdb get user/hello/hello/world  
kdb file user/hello/hello/world
vi /home/elektra/.config/hello.js
# Edit file to say "Hello World from File!"
kdb get user/hello/hello/world
kdb editor user/hello ini
# Edit file to say "Hello World from INI!"
kdb get user/hello/hello/world
kdb export user/hello 
kdb export user/hello tcl
kdb export user/hello yaml                                      > NEW LINE
kdb rm user/hello/hello/world
cat /home/markus/.config/hello.ini     
sudo kdb umount /hello
echo "Now let us change something.. With validation"
vi specification.ini                                       > NEW START
# content:
# []
# mountpoint = specification.ini
# [hostip]
# check/ipaddr =
# [timeout]
# check/range = 0-100
sudo kdb mount /home/elektra/specification.ini spec/validation ni
sudo kdb spec-mount /validation
kdb set /validation/hostip 123.123.123.1233
kdb set /validation/timeout 500
kdb editor spec/validation ni
#edit range to 1000
kdb set /validation/timeout 500
sudo kdb umount spec/validation                                      
kdb rm -r /validation                                           > NEW END
echo "What to do next???"
kdb
kdb --help
kdb --find-tools

@markus2330
Copy link
Contributor Author

Wow, you even scripted it 👍 . I am already looking forward to the result.

Can you put the script into a PR so that we can discuss line-by-line?

At first glance I notice:

  • many more echo would be helpful (it gives the reader more time to realize what is happening)
  • the specification is better to be built up step by step, not everything at once
  • did you see the demo in https://archive.fosdem.org/2018/schedule/event/elektra/
  • hosts plugin is missing (so that implicit validation without a specification is shown)

Btw. I just read that https://github.com/dhobsd/castty supports audio 😉

@ghost
Copy link

ghost commented Dec 4, 2019

Can you put the script into a PR so that we can discuss line-by-line?

#3320

@ghost ghost removed their assignment Dec 13, 2019
@markus2330 markus2330 mentioned this issue Nov 1, 2020
20 tasks
@stale
Copy link

stale bot commented Dec 12, 2020

I mark this issue stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping the issue by writing a message here or create a new issue with the remainder of this issue.
Thank you for your contributions 💖

@stale stale bot added the stale label Dec 12, 2020
@markus2330 markus2330 removed the stale label Dec 13, 2020
@markus2330 markus2330 self-assigned this Dec 13, 2020
@markus2330 markus2330 removed their assignment Sep 22, 2021
@markus2330 markus2330 added 7p seven points cm2022s for university course labels Mar 7, 2022
@markus2330 markus2330 added floss2022w and removed cm2022s for university course labels Sep 25, 2022
@markus2330 markus2330 changed the title AsciiNema improvements [FLOSS T2] AsciiNema improvements Sep 25, 2022
@markus2330 markus2330 removed the 7p seven points label Sep 27, 2022
@flo91 flo91 added lang/web js, css, html etc. lang/shell labels Oct 5, 2022
@markus2330 markus2330 changed the title [FLOSS T2] AsciiNema improvements AsciiNema improvements Jan 14, 2023
Copy link

I mark this stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping by writing a message here or create a new issue with the remainder of this issue.
Thank you for your contributions 💖

@github-actions github-actions bot added the stale label Feb 10, 2024
Copy link

I closed this now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue.
Thank you for your contributions 💖

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants