monaqa / slydifi

Create a slide with SATySFi!
MIT License
55 stars 7 forks source link

Gitpod seems not work #25

Closed pickoba closed 2 years ago

pickoba commented 2 years ago

First of all, thanks for the great libraries! I have recently been having fun creating slides using SLyDIFi 😄

What I've encountered When I opened this repo in Gitpod using the link on README, I got the following error in the integrated terminal:

 HISTFILE=/workspace/.gitpod/cmd-0 history -r; {
export PATH=/home/gitpod/.opam/4.10.0/bin:$PATH;./entrypoint.sh
} && {
satysfi demo/demo.saty; open demo/demo.saty demo/demo.pdf
}
od/cmd-0 history -r; {9j2bk08qpv5:/workspace/slydifi$  HISTFILE=/workspace/.gitpo
> export PATH=/home/gitpod/.opam/4.10.0/bin:$PATH;./entrypoint.sh
> } && {
> satysfi demo/demo.saty; open demo/demo.saty demo/demo.pdf
> }
[ERROR] Opam has not been initialised, please run `opam init'
[ERROR] Opam has not been initialised, please run `opam init'
[ERROR] Opam has not been initialised, please run `opam init'
./entrypoint.sh: 9: satyrographos: not found
gitpod@monaqa-slydifi-9j2bk08qpv5:/workspace/slydifi$ 

It seems that opam is not initialized correctly. I have also tried Gitpod with other libraries such as easytable, and got the same error.

It is probably because the user who invoked opam init (root) and the user on Gitpod (gitpod) are different.

monaqa commented 2 years ago

Thanks for the report. I don't usually use gitpod or docker-satysfi, so I have no idea how to solve this problem. Do you have any good ideas?

pickoba commented 2 years ago

To be honest, I also have no idea because I don't usually use gitpod too...

But it seems to me that it need to be done it manually, including the installation of SATySFi, as a normal user. I have tried the following configuration in my private repo and it works fine.

# .gitpod.Dockerfile
FROM gitpod/workspace-base

RUN sudo install-packages opam

USER gitpod

RUN echo '. /home/gitpod/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true' >> /home/gitpod/.bashrc
RUN opam init --disable-sandboxing

RUN eval $(opam env) && opam repository add satysfi-external https://github.com/gfngfn/satysfi-external-repo.git
RUN eval $(opam env) && opam repository add satyrographos https://github.com/na4zagin3/satyrographos-repo.git
RUN eval $(opam env) && opam update

RUN eval $(opam env) && opam install --yes satysfi satysfi-dist satyrographos
RUN eval $(opam env) && satyrographos install

But this of course takes a lot of time to build the image.

monaqa commented 2 years ago

Thank you!

Hmm, if the Dockerfile is going to be somewhat complicated or manual one, it might be better to create a separate repository for a quick trial of SATySFi. This is the SLyDIFi repository, and the Gitpod demo environment is just an adjunct, so I would like to avoid seriously maintaining Dockerfile here.

pickoba commented 2 years ago

May I create a docker image for Gitpod + SATySFi which can be used here?

I'm currently planning to release SATySFi Workshop to Open VSX (Marketplace for Gitpod, etc.), so I think I would be the right person to manage it 👍

monaqa commented 2 years ago

I too have been thinking how great it would be if the SATySFi workshop was available online. I would be extremely grateful if you could do that for me!

pickoba commented 2 years ago

I’ve just created a docker image (pickoba/gitpod-satysfi) and a template which use it! You can now use SATySFi, Satyrographos, and satysfi-language-server on Gitpod!

monaqa commented 2 years ago

Excellent!! I have confirmed that your Gitpod template does indeed work in this repository.

Thank you again!