Altai-man / docs.raku.org

Source code of a beta version of the updated docs.raku.org website
Artistic License 2.0
11 stars 5 forks source link

Examples runner need to display its status clearly #24

Closed Altai-man closed 3 years ago

Altai-man commented 3 years ago

Right now, when Run button on the example is clicked, nothing visually says about what happens... And then the result appears. However, it may take a long time and it's a bad thing to make the user worry about what is happening.

Thus we need to give a clean visual hints about what's happening, say a spinner with "We process your request blah blah" kind of thing.

The relevant code is at https://github.com/Altai-man/docs.raku.org/blob/master/static/js/core.js#L84-L109

Altai-man commented 3 years ago

It is also a good idea to have some better UI presentation for stdout and stderr, the current layout is too simplistic.

CodeCanna commented 3 years ago

I wouldn't mind tackling this one! :)

Altai-man commented 3 years ago

Glad to know! Feel free to PR a solution, instructions on how to setup a local dev environment are in the readme.

CodeCanna commented 3 years ago

I got the environment set up, I had to re-learn some docker but I got it up. I'm getting "Error occurred: error" for all output when any run button is clicked. That's not expected behavior is it?

Altai-man commented 3 years ago

See https://github.com/Altai-man/docs.raku.org#examples-execution

In short, you need to setup another docker container with the server executing examples:

docker pull glot/docker-run:latest
docker pull glot/raku:latest
docker run --detach --restart=always --publish 8088:8088 --volume /var/run/docker.sock:/var/run/docker.sock --env "API_ACCESS_TOKEN=my-token" glot/docker-run:latest

^ please replace my-token with something sensible (though for local development I guess just my-token is fine enough) and then you specify two additional env variables for the website:

DOCKY_EXAMPLES_EXECUTOR_HOST
(and)
DOCKY_EXAMPLES_EXECUTOR_KEY

where the first one is something like http://localhost:8088/run and the second one is the token you specified.

CodeCanna commented 3 years ago

where the first one is something like http://localhost:8088/run and the second one is the token you specified. I'm guessing it should be some sort of generated UUID or something similar?

Altai-man commented 3 years ago

I'm guessing it should be some sort of generated UUID or something similar?

I think it is just checked to be equal. I mean, you pass it when starting a docker container with the runner (--env "API_ACCESS_TOKEN=my-token" bit in the command) and then you need to pass an exactly the same token to the website engine. Something like a random UUID will work, maybe something simpler like foo will work just as good.

CodeCanna commented 3 years ago

I think I got it lol, had to install.

CodeCanna commented 3 years ago

Ok so I have been fighting with this for a while today, for some reason, when the run buttons are clicked it shoots the POST request to http://localhost:20000 but I have

DOCKY_EXAMPLES_EXECUTOR_HOST and DOCKY_EXAMPLES_EXECUTOR_KEY set

I see where they are set in Routes.pm6 and it grabs it from the env vars which I have set.

Altai-man commented 3 years ago

What is the value you set to DOCKY_EXAMPLES_EXECUTOR_HOST?

Also, are you running it with docker or not? If you are running it with docker, the environment variables simply set in shell won't be visible, you need to pass them with --env flag, see e.g. https://stackoverflow.com/questions/30494050/how-do-i-pass-environment-variables-to-docker-containers

CodeCanna commented 3 years ago

I see, I'm not using the --env flag so that's probably it. I am setting those variables in the shell. I'm still pretty new to docker, thanks for being patient with me :)

CodeCanna commented 3 years ago

Ok so I tried two main examples from Stack-O and neither worked sadly, but I can show what I did.

Attempt 1: I followed the manual steps to getting the site running, then I tried DOCKY_EXAMPLES_EXECUTOR_HOST='http://localhost:8088/run' DOCKY_EXAMPLES_EXECUTOR_KEY='foo' DOCKY_PORT=20000 DOCKY_HOST=localhost raku -Ilib service.p6

Attempt 2: I deleted everything and cloned a fresh copy and followed the docker example. sudo docker run --env DOCKY_EXAMPLES_EXECUTOR_HOST='http://localhost:8088/run' --env DOCKY_EXAMPLES_EXECUTOR_KEY='foo' -p 10000:10000 next-docs

Attempt 2.5: $ DOCKY_EXAMPLES_EXECUTOR_HOST='http://localhost:8088/run' $ DOCKY_EXAMPLES_EXECUTOR_KEY='foo' $ sudo docker run --env DOCKY_EXAMPLES_EXECUTOR_HOST --env DOCKY_EXAMPLES_EXECUTOR_KEY -p 10000:10000 next-docs

Attempt 3: $ export DOCKY_EXAMPLES_EXECUTOR_HOST='http://localhost:8088/run' $ export DOCKY_EXAMPLES_EXECUTOR_KEY='foo' $ sudo docker run --env DOCKY_EXAMPLES_EXECUTOR_HOST --env DOCKY_EXAMPLES_EXECUTOR_KEY -p 10000:10000 next-docs

All of these attempts have the same result for me, the run code button sends a POST request to localhost:10000, and I get this Raku error message:

Use of uninitialized value of type Any in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
  in method parse at /opt/rakudo-pkg/share/perl6/site/sources/ED8D50D940CE504E69D0DF947069CEA3CDEB0E27 (Cro::Uri) line 342
Unable to parse URI '': Malformed scheme
  in method panic at /opt/rakudo-pkg/share/perl6/site/sources/ED8D50D940CE504E69D0DF947069CEA3CDEB0E27 (Cro::Uri) line 202
  in regex URI at /opt/rakudo-pkg/share/perl6/site/sources/ED8D50D940CE504E69D0DF947069CEA3CDEB0E27 (Cro::Uri) line 55
  in regex TOP at /opt/rakudo-pkg/share/perl6/site/sources/ED8D50D940CE504E69D0DF947069CEA3CDEB0E27 (Cro::Uri) line 51
  in method parse at /opt/rakudo-pkg/share/perl6/site/sources/ED8D50D940CE504E69D0DF947069CEA3CDEB0E27 (Cro::Uri) line 344
  in method request at /opt/rakudo-pkg/share/perl6/site/sources/B500D4CDC421AF9AD474418C628D330F36F5FA98 (Cro::HTTP::Client) line 421
  in method post at /opt/rakudo-pkg/share/perl6/site/sources/B500D4CDC421AF9AD474418C628D330F36F5FA98 (Cro::HTTP::Client) line 379
  in block  at /app/lib/Docky/Routes.pm6 (Docky::Routes) line 173
  in block  at /opt/rakudo-pkg/share/perl6/site/sources/45B811289E008CD963B13A97AC3DCA707B5771A6 (Cro::HTTP::Router) line 136
  in block  at /opt/rakudo-pkg/share/perl6/site/sources/45B811289E008CD963B13A97AC3DCA707B5771A6 (Cro::HTTP::Router) line 132

[ERROR] 500 /run - 172.17.0.1

These variables aren't getting set for me.

EDIT:

Just for fun I tried sudo docker run --env $DOCKY_EXAMPLES_EXECUTOR_HOST --env $DOCKY_EXAMPLES_EXECUTOR_KEY -p 10000:10000 next-docs after exporting them in the shell and no joy.

Altai-man commented 3 years ago

Woah, what a "beta version" experience. :/ I am sorry you have to tinker so much on this.

I believe it will work if you do the following:

1)Open Dockerfile file and add DOCKY_EXAMPLES_EXECUTOR_HOST='http://localhost:8088/run' DOCKY_EXAMPLES_EXECUTOR_KEY='foo' to ENV section of it 2)Re-build an image (maybe deleting previous ones) and docker run it.

This is not very convenient, but I am 99% sure it will work fine.

CodeCanna commented 3 years ago

It's okay, really I'm just happy to be working on the project :) The Raku language is really cool. Gonna try it.

CodeCanna commented 3 years ago

Sorry to say no luck here either. But just to eliminate user error, I want to make sure I have everything correct:

Dockerfile: ENV PATH=/root/.raku/bin:/opt/rakudo-pkg/bin:/opt/rakudo-pkg/share/perl6/site/bin:$PATH DOCKY_PORT="10000" DOCKY_HOST="0.0.0.0" DOCKY_EXAMPLES_EXECUTOR_HOST='http://localhost:8088/run' DOCKY_EXAMPLES_EXECUTOR_KEY='foo'

$sudo docker build -t next-docs -f Dockerfile . $ sudo docker run -p 10000:10000 next-docs

This should work right? The site loads fine and all the content is there, it's just sending the request to the wrong place.

Altai-man commented 3 years ago

Hmm. The difference I see is ' instead of ", but it should not matter.

This is weird, it works for me. Well, another option is to simply inline the address and token at https://github.com/Altai-man/docs.raku.org/blob/master/lib/Docky/Routes.pm6#L168-L170 just to make it going enough until an investigation of this case is possible (I am now optimizing page loading times).

So something like:

                my $resp = await Cro::HTTP::Client.post('http://localhost:8088/run',
                        content-type => 'application/json',
                        headers => ['X-Access-Token' => 'foo'],
CodeCanna commented 3 years ago

That's what i was thinking of doing next. But if it works for you, then I'm missing something. Because it works. I'm gonna keep at it, it's probably something stupid on my part.

raydiak commented 3 years ago

I don't know if my issue is related to yours, but I've been working on this for the past few hours and thought I'd share a couple things I noticed:

It is totally normal and expected to see that POST go to port 10000 before it goes to port 8088 to access the other container. https://github.com/Altai-man/docs.raku.org/blob/9528de11dfe65c88287735e287fec0c038c6385a/static/js/core.js#L93 sends that POST to the current host (and port) quite deliberately. Otherwise you'd run into XHR cross-origin security policy issues. https://github.com/Altai-man/docs.raku.org/blob/9528de11dfe65c88287735e287fec0c038c6385a/lib/Docky/Routes.pm6#L168 relays that POST from our server to the server running in the glot container.

I haven't even gotten to messing with the environment variables yet, because my first issue appears to be that the glot/docker-run container itself on port 8088 isn't working even when accessed directly. I get valid responses at / and /version, but at /run all I get no matter what I try to execute is:

$ curl --request POST --header 'X-Access-Token: my-token' --header 'Content-type: application/json' --data '{"image": "glot/raku:latest", "payload": {"language": "raku", "files": [{"name": "main.raku", "content": "print(42)"}]}}' http://localhost:8088/run
{
  "error": "coderunner.stdout.decode",
  "message": "Failed to decode json returned from code runner: EOF while parsing a value at line 1 column 0"
}

Which results in the same '"Error occurred: error" for all output when any run button is clicked' behavior reported in this discussion. This means at least my own failure has nothing to do with our work here, but is instead a manifestation of (not entirely explained but closed anyway) https://github.com/glotcode/docker-run/issues/1 but nothing there has worked for me so far. Pretty sure I followed https://github.com/glotcode/docker-run/blob/05fae20d91311a00680fe1e0f082bfd7c8524ba2/docs/install/docker-ubuntu-20.10.md correctly. I tried python and got the same error so it's not specific to the glot/raku image, either. Perhaps there's some extra step or misconfiguration on my end, but it's a totally fresh install of docker by the instructions. I'm running Kubuntu 20.04 (admittedly the instructions are for 20.10, but I'm unaware of a pertinent difference).

That's as far as I've taken this investigation so far. I hope it helps. If nothing else, try that curl line above and make sure your docker-run container is working, unlike mine. You could have this issue on top of your env var problem, complicating your troubleshooting process.

CodeCanna commented 3 years ago

I am getting this as well, I'm pretty much getting the same behavior .

EDIT: Actually I'm getting

{
  "error": "limits.execution_time",
  "message": "Failed while reading stream: Max execution time exceeded"
}

I've actually been getting so many different error messages lol. But mostly this.

raydiak commented 3 years ago

Oh, interesting. You get that while running the same curl line as above, directly to docker-run at :8088? I've been noticing what seem to be huge performance slowdowns with the docs container itself, but I haven't seen it hit an actual timeout at any point so far

Altai-man commented 3 years ago

because my first issue appears to be that the glot/docker-run container itself on port 8088 isn't working even when accessed directly

Alas, I cannot reproduce it.

➜  ~ curl --request POST --header 'X-Access-Token: 941E8B5F668CB55A4633ABA14EB59' --header 'Content-type: application/json' --data '{"image": "glot/raku:latest", "payload": {"language": "raku", "files": [{"name": "main.raku", "content": "say 42;"}]}}' http://178.128.54.210:8088/run
{"error":"","stderr":"","stdout":"42\n"}

@raydiak , can you try out exactly this ^ ? This is a temporary server with a container I set up and it seems to work reliably for me.

As for env variables: I am truly sorry, it seems I confused myself and others. --env does not actually change env inside of the container, but seems to affect it at the builds stage, so run --env is too late for this to take place. I think the very dirty workaround is to simply inline host/token as I suggested (you can even go with the ones in my query above) in the code, fix this ticket ??? get some nice results.

And then it will be a separate issue for setting up a nice and reliable way to populate this data during deployment.

CodeCanna commented 3 years ago

@Altai-man see this works for me.

CodeCanna commented 3 years ago

But I also forked the project and hooked it up with my own Glotio account and was able to use their API to achieve the same result lol.

EDIT:

I'm following this procedure by the way: https://github.com/glotcode/docker-run/blob/main/docs/install/docker-ubuntu-20.10.md And I've tried this one: https://github.com/glotcode/docker-run/blob/main/docs/install/ubuntu-20.10.md

I can't wait to get home from work and play with this some more when I'm home, sadly I'm not lucky enough to do this for a living lol.

raydiak commented 3 years ago

@Altai-man that works, it's only my own container which is broken:

$ curl --request POST --header 'X-Access-Token: 941E8B5F668CB55A4633ABA14EB59' --header 'Content-type: application/json' --data '{"image": "glot/raku:latest", "payload": {"language": "raku", "files": [{"name": "main.raku", "content": "say 42;"}]}}' http://178.128.54.210:8088/run
{"error":"","stderr":"","stdout":"42\n"}

I may not have time to investigate further for a couple days, but I'll let you know if I discover anything useful to add to the instructions. Since nobody else is having my exact problem, at least hopefully nobody else should be affected.

WRT the env vars, I see we're assigning them to constants: https://github.com/Altai-man/docs.raku.org/blob/4e3e4857658e209b02b72fae212047e07bb42525/lib/Docky/Routes.pm6#L19-L20 but https://docs.raku.org/routine/constant says "The value is assigned at compile time. Since Raku modules are precompiled automatically, constants defined in modules are not re-evaluated when the program is run. Please check the section on constants in the Terms page for additional information." So changing those to "my" instead of "constant" may solve it.

Altai-man commented 3 years ago

@raydiak thanks for your input! Given there is a setup that works and also a setup that works for local dev, it is not a critical issue to investigate them right now, in fact playing with the original ticket goal is maybe a higher priority. I fixed another bug in examples execution recently, so it'd be cool to deploy both the UI fix and my bugfix.

raydiak commented 3 years ago

@Altai-man sounds good, I'll make a PR for the env var fix when I get back to it. Was just throwing my two cents in here for the debugging. I won't actually be working on this specific issue as @CodeCanna already volunteered and just finally got a working setup :)

CodeCanna commented 3 years ago

Just for future reference what is a PR?

Edit: And just as I hit enter, it hit me. Pull Request.

Altai-man commented 3 years ago

Ping?

CodeCanna commented 3 years ago

Ping?

Update: I still haven't even gotten the site working with Glot. Even with the online API, because I don't have CRO installed correctly. I think that's my problem. If anyone wants to step up on this one since I am have so much trouble getting a working environment and ill tag back in when I have it working. I do apologize for the silence but I was engrossed in trying to get it set up. I'll post error messages after I get back from work if you want, but I think I'm missing some C libraries that doesn't let CRO work properly.

Altai-man commented 3 years ago

Sorry to put you into so much trouble over this, thank you for your patience!

Are the problems persistent in Docker env as well?

CodeCanna commented 3 years ago

Sorry to put you into so much trouble over this, thank you for your patience!

This is programming, we literally seek out problems like these to solve :) I'm having fun. I just don't want to take forever, I know this is actually supposed to be a small edit.

Problems are persistent no matter what I do really because I'm missing two essential C libraries needed to build Cro or run Cro or something. I went on the Raku IRC and people on there said that it sounded like my version of Rakudo is missing some libs. They advised installing Rakudo through other means than APT.

CodeCanna commented 3 years ago

So after days of trying to get this running I'm no closer. So I decided to try and make my own small web page that implements Glot and a run button but i haven't even got that working. So it's obviously something I'm doing wrong. Can't seem to get Glot to work. I will yield this one to anyone who can get it to work. I need to do more research on Cro, Raku, and Glot.

Thanks for the opportunity though :)

Altai-man commented 3 years ago

@CodeCanna if you can provide any details on what issues you are facing...

In principle, just building and running a docker container with values hardcoded will utilize a completely separate virtual system and so there should be no issues related to your environment at all.

So I decided to try and make my own small web page that implements Glot and a run button but i haven't even got that working

Did you try host/key pair I posted above?

I am not going to force you if you are no willing to put any more time in this, I am just really curious about what can go wrong with the current setup.

CodeCanna commented 3 years ago

Honestly I don't want to give it up its just I feel like I'm taking too long. I'm a little new at contributing so I am nervous XD.

I will be happy to send you any data you need from my system. Let me know what you need and I'll get it after work.

Altai-man commented 3 years ago

I'm taking too long

Not really, this project takes its time, huh, I guess.

I'm a little new at contributing so I am nervous

No problem at all, everyone start with something.

I will be happy to send you any data you need from my system

Let's start with recreating the setup. So you have docker installed.

You can run curl --request POST --header 'X-Access-Token: 941E8B5F668CB55A4633ABA14EB59' --header 'Content-type: application/json' --data '{"image": "glot/raku:latest", "payload": {"language": "raku", "files": [{"name": "main.raku", "content": "say 42;"}]}}' http://178.128.54.210:8088/run from console and get an actual output ({"error":"","stderr":"","stdout":"42\n"}).

Say you clone the repository afresh. Then go to lib/Routes.pm6 and manually replace DOCKY_EXAMPLES_EXECUTOR_HOST, in the usage with 'http://178.128.54.210:8088/run' and the token as well, so that it becomes:

...
                my $resp = await Cro::HTTP::Client.post('http://178.128.54.210:8088/run',
                         content-type => 'application/json',
                        headers => ['X-Access-Token' => '941E8B5F668CB55A4633ABA14EB59'],
                         body => {
...

Then you do:

docker build -t docs-next -f infra/Dockerfile.cro .

and when it's successful (Successfully tagged docs-next:latest) you do this:

docker run -p 10000:10000 docs-next

then wait some time (3-5 minutes maybe) and try to access it at http://localhost:10000

If any of the steps above does not look successful just post details here and we'll sort it out.

I am also looking into making all this process simpler.

CodeCanna commented 3 years ago

Ok this is exciting! I'm not getting an error anymore, It seems to be WORKING!! It's ALIVE!

Ahem..sorry so it seems to work now, I don't think I was understanding what you wanted me to do correctly. I was still trying to send POST request to my local Glot container, which I haven't been able to get running. My misunderstanding.

Altai-man commented 3 years ago

Yay, glad it works for you.

Ok, so with a Docker container it will take you more time to test your changes (the container image has to be rebuilt and the container restarted to pickup local changes) than a local installation, but at least it guarantees you a really stable and reproducible environment.

So to see your changes you need to again do the building with the same command (docker build ...) and re-run with docker run ... from above.

If you need any further help please ping.

CodeCanna commented 3 years ago

UPDATE: I have the event of the button click, as well as the ajax success event. So now I'm working on a CSS solution. I'm thinking of adding an element with a spinning Camelia that has text under that says something like "Loading", or "Running Code", etc.

EDIT: You can see progress and give me any input at my codepen: https://codepen.io/codecanna/pen/ZELBmye

TODO: Center spinner over the text? If its liked the way it is I can implement it tomorrow! Let me know.

Altai-man commented 3 years ago

It looks very cool! I wonder if we can re-use the logo in the header to make less network requests.

"Loading", or "Running Code"

I think "Running Code" is more fitting here.

Center spinner over the text?

I am not so good with JS (UI) best practices, so I suspect you might have a better understanding here.

CodeCanna commented 3 years ago

The site doesn't seem to be working anymore, I don't get any error messages the run buttons do nothing. I'm trying to figure out where to add the HTML and CSS for this spinner, then I want to be able to test my changes. Is the Glot that we are using hosted by you?

I noticed that there are HTML in /templates but nothing about the run button that I can see.

Altai-man commented 3 years ago

Is the Glot that we are using hosted by you?

The one I posted is a throw-away container I am hosting, yes. I just restarted it and it seems to work now.

I'm trying to figure out where to add the HTML and CSS for this spinner

HTML for the code runner is at https://github.com/Altai-man/docs.raku.org/blob/master/lib/Docky/Renderer/Node.pm6#L91-L94

You can add CSS to https://github.com/Altai-man/docs.raku.org/blob/master/ui-samples/sass/base/_base.scss and then do npm run css-release in ui-samples directory to render final css from scss templates.

CodeCanna commented 3 years ago

UPDATE: I added my code to the run button code and left out my CSS so it would show all the time so I could see if my changes took place. I rebuilt the container but my changes aren't taking place. I looked into the DOM and its not there.

This is the code for the run button now, I added the spinner

my $code-runner = $lang && !detect-declaration($node.contents.join) ??
        q:to/END/
          <div class="code-output">
            <button class="button code-button" aria-label="run">Run</button>
            <div id="code-run-spinner-container">
                <div id="code-run-spinner">
                    <img id="camelia-spinner" src="../img/camelia-recoloured.png" alt="Raku Logo" width="50" />
                    <p>Running Code</p>
                </div>
            </div>
            <div></div>
          </div>
        END

I'm gonna do more research on CRO templates, maybe I have to make my own variable and put it in here:

qq:to/END/;
        <div class="raku-code$lang">
          $content
          $code-runner
        </div>

But that still doesn't explain why I don't see the changes at all.

Altai-man commented 3 years ago

Can you please describe how you rebuilt the container? Also output of docker ps, docker images.

CodeCanna commented 3 years ago

I used docker build -t docs-next -f infra/Dockerfile.cro . to build, ill get you the output of the other command shortly :)

CodeCanna commented 3 years ago

Output of docker ps:

CONTAINER ID   IMAGE       COMMAND                  CREATED       STATUS       PORTS                      NAMES
5f7939535de0   docs-next   "/bin/sh -c 'raku -I…"   4 hours ago   Up 4 hours   0.0.0.0:10000->10000/tcp   sweet_bouman

Output of docker images:

REPOSITORY        TAG       IMAGE ID       CREATED       SIZE
<none>            <none>    4be6ab1f139e   4 hours ago   203MB
<none>            <none>    d338133bf8b3   5 hours ago   203MB
docs-next         latest    119bc67c2625   4 days ago    1.29GB
<none>            <none>    c610e8f82e93   4 days ago    1.29GB
<none>            <none>    5b2f61e32b22   4 days ago    1.29GB
<none>            <none>    dc2ae84ba0b7   4 days ago    1.29GB
<none>            <none>    b8eedf62f93c   4 days ago    1.29GB
glot/docker-run   latest    1de10e561948   6 weeks ago   35.5MB
fedora            32        eb7f88a194d8   6 weeks ago   202MB
Altai-man commented 3 years ago

Hmm, I wonder why the image built 4 hours ago (apparently re-built) is not properly tagged? Instead the one from 4 days ago is tagged and is apparently used. Maybe there were some errors at the end of the docker build command execution log?

I would do this:

docker stop 5f7939535de0 # stop the currently running container
docker rm (docker container ls -aq) # remove all stopped containers
docker image prune --all # remove all images

to do a full cleanup and then done a clean build and run. At the end of the build command it says Successfully built and tagged ..., if it is not so it's likely you won't get the updated image and it's a matter of investigating what went wrong.

CodeCanna commented 3 years ago

I'm gonna try deleting all the docker images I have and then rebuild. I think it's the old images messing it up. I'm still very new to Docker too.

Edit: It looks like that was you're suggestion as well XD

CodeCanna commented 3 years ago

Update: I can see my changes! Now adding the CSS has presented a new problem. I ran into this error while trying to run npm run css-release.

Error:

> raku-docs@1.0.0 css-release
> npm run css-build && npm run css-optimize

> raku-docs@1.0.0 css-build
> npx node-sass --source-map=true sass --output ../static/css

{
  "status": 1,
  "file": "/home/codecanna/GitHub/docs.raku.org/ui-samples/sass/code/dark.scss",
  "line": 1,
  "column": 1,
  "message": "File to import not found or unreadable: ../../node_modules/bulma/sass/utilities/functions.sass.",
  "formatted": "Error: File to import not found or unreadable: ../../node_modules/bulma/sass/utilities/functions.sass.\n        on line 1 of sass/code/dark.scss\n>> @import \"../../node_modules/bulma/sass/utilities/functions.sass\";\n\n   ^\n"
}
npm ERR! code 1
npm ERR! path /home/codecanna/GitHub/docs.raku.org/ui-samples
npm ERR! command failed
npm ERR! command sh -c npx node-sass --source-map=true sass --output ../static/css

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/codecanna/.npm/_logs/2021-04-04T01_33_01_477Z-debug.log
npm ERR! code 1
npm ERR! path /home/codecanna/GitHub/docs.raku.org/ui-samples
npm ERR! command failed
npm ERR! command sh -c npm run css-build && npm run css-optimize

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/codecanna/.npm/_logs/2021-04-04T01_33_01_637Z-debug.log

This is the contents of the error log /home/codecanna/.npm/_logs/2021-04-04T01_33_01_637Z-debug.log:

0 verbose cli [ '/usr/bin/node', '/usr/local/bin/npm', 'run', 'css-release' ]
1 info using npm@7.6.3
2 info using node@v12.18.2
3 timing config:load:defaults Completed in 1ms
4 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 2ms
5 timing config:load:builtin Completed in 2ms
6 timing config:load:cli Completed in 1ms
7 timing config:load:env Completed in 1ms
8 timing config:load:file:/home/codecanna/GitHub/docs.raku.org/ui-samples/.npmrc Completed in 0ms
9 timing config:load:project Completed in 0ms
10 timing config:load:file:/home/codecanna/.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:/etc/npmrc Completed in 1ms
13 timing config:load:global Completed in 1ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 7ms
19 verbose npm-session 30e145b4e453e1ea
20 timing npm:load Completed in 14ms
21 timing command:run Completed in 2032ms
22 verbose stack Error: command failed
22 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
22 verbose stack     at ChildProcess.emit (events.js:315:20)
22 verbose stack     at maybeClose (internal/child_process.js:1021:16)
22 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
23 verbose pkgid raku-docs@1.0.0
24 verbose cwd /home/codecanna/GitHub/docs.raku.org/ui-samples
25 verbose Linux 5.8.0-7642-generic
26 verbose argv "/usr/bin/node" "/usr/local/bin/npm" "run" "css-release"
27 verbose node v12.18.2
28 verbose npm  v7.6.3
29 error code 1
30 error path /home/codecanna/GitHub/docs.raku.org/ui-samples
31 error command failed
32 error command sh -c npm run css-build && npm run css-optimize
33 verbose exit 1
CodeCanna commented 3 years ago

Never mind I fixed this with npm install

Edit: At least I thought I did, it runs with no errors now but it still doesn't work. The dev tools in the browser are telling me that the _base.scss isn't found with error 500.

error_raku_css

Altai-man commented 3 years ago

The dev tools in the browser are telling me that the _base.scss isn't found with error 500.

This is normal, we don't serve them.

At least I thought I did, it runs with no errors now but it still doesn't work

Did you successfully rebuild a container after adding and re-generating CSS?