I'm trying to setup automatic building of neuron web on Gitlab, though approach taken in github template seems to use Github API for receiving neuron binary, which requires token for access - is there some "public" way of receiving "neuron bundle"?
I would like download linux bundles of neuron in CI outside of Github (https://funprog.zulipchat.com/#narrow/stream/231929-Neuron/topic/Gitlab.20Pages/near/204132793), but Github API seems to requi...
Hmm, I'm having some problems with input and output directories to neuron:
First, neuron rib doesn't seem to like relative paths in -o - it doesn't seem to output anything at all when given one, even though it lists built files as usually
Second, while trying to build page on GitLab, it fails to find directory given through -d even though I literally list it's content before running neuron
Not sure whether I'm missing something or whether this is a bug
Second, while trying to build page on GitLab, it fails to find directory given through -d even though I literally list it's content before running neuron
@Sridhar Ratnakumar I'm not sure whether I can use non-Docker configuration on hosted CI - is there some specific reason why nix-bundle shouldn't play well with it?
Hi, I would like to package a Nix app (seth) to a non-NixOs docker image (i.e alpine) with nix-bundle.sh. Here's my Dockerfile: FROM nixos/nix as buildSeth RUN adduser -D sethservice &&...
Hmm, maybe
I've tried running alpine:latest image locally (Arch Linux host) and I'm getting this, even after doing what it says and checking that setting:
~ # ./neuron -d . rib -o output
Run the following to enable unprivileged namespace use:
sudo bash -c "sysctl -w kernel.unprivileged_userns_clone=1 ; echo kernel.unprivileged_userns_clone=1 > /etc/sysctl.d/nix-user-chroot.conf"
> nix-build docker.nix --show-trace
error: while evaluating the attribute 'buildCommand' of the derivation 'docker-image-neuron.tar.gz' at /nix/store/km5w6fszy4bcs9q13mr3biabirshrrgw-nixpkgs-20.09pre226024.873e114cf49/nixpkgs/pkgs/build-support/trivial-builders.nix:7:7:
while evaluating the attribute 'contents' of the derivation 'docker-layer-neuron' at /nix/store/km5w6fszy4bcs9q13mr3biabirshrrgw-nixpkgs-20.09pre226024.873e114cf49/nixpkgs/pkgs/build-support/trivial-builders.nix:7:7:
cannot coerce a function to a string, at /nix/store/km5w6fszy4bcs9q13mr3biabirshrrgw-nixpkgs-20.09pre226024.873e114cf49/nixpkgs/pkgs/build-support/trivial-builders.nix:7:7
CI should automatically publish the docker image from the project root's docker.nix. In effect, run these commands in CI: docker load -i $(nix-build docker.nix) docker login ... docker push sri...
another PR to make (possibly automated) custom docker.nix builds easier bash_5 and coreutils seem to add some size, maybe they could be replaced with something like busybox?
This makes it more convenient to build custom images (possibly with shell included) using --arg flags in nix-build.
investigate possibility of lowering shell footprint
I'm trying to setup automatic building of neuron web on Gitlab, though approach taken in github template seems to use Github API for receiving neuron binary, which requires token for access - is there some "public" way of receiving "neuron bundle"?
https://github.com/srid/neuron/issues/292
Responded. @TheMatten as a quick workaround meanwhile I suppose you can just commit the bundle executable to your repo, and update it once in a while.
https://github.com/srid/neuron/pull/293
Merged - @Sridhar Ratnakumar thanks!
Hmm, I'm having some problems with input and output directories to
neuron
:First,
neuron rib
doesn't seem to like relative paths in-o
- it doesn't seem to output anything at all when given one, even though it lists built files as usuallySecond, while trying to build page on GitLab, it fails to find directory given through
-d
even though I literally list it's content before runningneuron
Not sure whether I'm missing something or whether this is a bug
@TheMatten What's the full neuron CLI ?
-d
should appear before any subcommand. I can't find the CLI you used from the link above.See commit on the right side - I use it that way
@TheMatten Try
set -x
so it spits out the actual command.Your gitlab yml has:
I can't tell what those env vars contain (or if they are empty)
And yea, you need absolute path. That's the limitation of using nix-bundle
Ah, I missed this
something to do with nix-bundle not playing well with mounted directories? i see you are using docker
can you do away with not using docker? the bundle should run on linux 64-bit
potential workaround if you can't find a good fix:
cp -r $CI_PROJECT_DIR proj; neuron -d $(pwd)/proj rib ...
@Sridhar Ratnakumar I'm not sure whether I can use non-Docker configuration on hosted CI - is there some specific reason why
nix-bundle
shouldn't play well with it?BTW,
$CI_PROJECT_DIR
points to working directory of cloned repono idea; something to do with chroot? https://github.com/matthewbauer/nix-bundle/issues/56
Hmm, maybe
I've tried running
alpine:latest
image locally (Arch Linux host) and I'm getting this, even after doing what it says and checking that setting:If nothing works, then you might as well
nix-env -i ...
it directly (after having done 'cachix use srid'). Should take no more than 2mins.Or, we push docker image in neuron CI (see
docker.nix
in neuron repo)let me update it
@TheMatten fixed
would be nice to have CI automatically build and push this to https://hub.docker.com/r/sridca/neuron
I jush did a one-off push to the hub
docker hub says image size is "80.75 MB" which is curious
Screen-Shot-2020-07-19-at-5.44.22-PM.png
Not bad at all ... 80mb download on mac, and it just works
Sridhar Ratnakumar said:
https://github.com/srid/neuron/issues/146
I ended up making custom docker image with
bash_5
andcoreutils
, but it works now perfectly!Nice. How long does it take for the CI to run?
Haha, it's actually around 25 seconds, so I didn't even have to change the number in FAQ :big_smile:
I think GitLab Pages template should now be ready for use: https://gitlab.com/thematten/neuron-template
I've created PR to include it in docs in case you're interested
another PR to make (possibly automated) custom
docker.nix
builds easierbash_5
andcoreutils
seem to add some size, maybe they could be replaced with something likebusybox
?Great, will take look!
Does gitlab support gitlab-pages on private repositories for free accounts? (github does not)
oh
See https://about.gitlab.com/pricing/ > "Are GitLab Pages included in the free plan?":