cachix / devenv

Fast, Declarative, Reproducible, and Composable Developer Environments
https://devenv.sh
Apache License 2.0
3.56k stars 259 forks source link

mongodb: initial user creation #679

Closed samjwillis97 closed 1 month ago

samjwillis97 commented 11 months ago

Addressing issue #672.

This allows the creation of an initial user with password in MongoDB.

domenkozar commented 11 months ago

Nice! Could you write a little test so we can be aire it works?

See .test.sh files in other examples.

samjwillis97 commented 11 months ago

Sure can 😄

samjwillis97 commented 11 months ago

I've added a test for MongoDB with initial user creation, let me know if there are any other changes

stig commented 11 months ago

I'm giving this a spin locally :-)

samjwillis97 commented 11 months ago

Thats great to hear, I'm glad

domenkozar commented 11 months ago

It seems that the tests are stuck, maybe you can take a look?

samjwillis97 commented 11 months ago

I think its still in the build step.. the nscloud-arm64 failed whilst building 2 hours in

samjwillis97 commented 11 months ago

So it looks like it was the build step, both macos-latest and self-hosted, macOS tests passed, but the ubuntu-latest and nscloud-arm64 ran out of space whilst building 😕

domenkozar commented 10 months ago

I pushed a fix to main, could you rebase and let's see if it works?

samjwillis97 commented 10 months ago

just rebased it, ready to give it another go :crossed_fingers:

samjwillis97 commented 10 months ago

Looks like we're getting the same failures :disappointed: Would it be an option to build mongo out of the actions and push up to cachix? Although when there are changes to the mongo package this problem will arise again..

domenkozar commented 10 months ago

Let's try giving it more space, could you add this action instead of my rm -rf /opt hack?

- name: Maximize build space
        uses: easimon/maximize-build-space@master
        with:
          remove-dotnet: true
          remove-android: true
          remove-codeql: true
samjwillis97 commented 10 months ago

Alright, thats in there now

domenkozar commented 10 months ago

/Users/runner/work/_temp/01d09040-1cc8-4083-b06d-97ad163b6af8.sh: line 2: free: command not found

domenkozar commented 10 months ago

Do you need help here?

samjwillis97 commented 10 months ago

I need to get my head back into this and have a look around with what we can do, I will let you know how I go

samjwillis97 commented 10 months ago

Finally getting back into this. Turns out the maximize-build-space action only support linux as mentioned in this issue https://github.com/easimon/maximize-build-space/issues/7./

It was the ubuntu-latest and nscloud-arm64 that have been running out of storage, so we could conditionally run the action for ubuntu-latest runners? This still doesn't solve for nscloud-arm64 which looks to start with 55GB space which I would have thought was plenty 😞

I'm also a bit confused about the ubuntu-latest runners because none of their tests passed either, but I'm unable to find a clear reason for the failure - the logs I have looked through are pretty clear, was it potentially caused by the actions being cancelled? or am I missing something?

domenkozar commented 10 months ago

Maybe the issue is that $TMP or something gets filled in? Most likely if it happens during the build.

domenkozar commented 8 months ago

Could you rebase and let's give it another go?

domenkozar commented 3 months ago

@samjwillis97 could you rebase again please? :)

samjwillis97 commented 3 months ago

I'll give it a go today :)

domenkozar commented 2 months ago
building '/nix/store/k5h9y3g5gs1r54wihhwpg1hi32yw7jp9-mongodb-6.0.12.drv'...
error: builder for '/nix/store/k5h9y3g5gs1r54wihhwpg1hi32yw7jp9-mongodb-6.0.12.drv' failed with exit code 2;
       last 10 log lines:
       > src/mongo/util/ctype.h:190:40: error: ‘kPrint’ is not a member of ‘mongo::ctype::detail’
       >   190 |     return detail::isMember(c, detail::kPrint);
       >       |                                        ^~~~~~
       > src/mongo/util/ctype.h: In function ‘constexpr bool mongo::ctype::isPunct(char)’:
       > src/mongo/util/ctype.h:193:40: error: ‘kPunct’ is not a member of ‘mongo::ctype::detail’
       >   193 |     return detail::isMember(c, detail::kPunct);
       >       |                                        ^~~~~~
       > scons: *** [build/nixos/mongo/db/query/analyze_regex.o] Error 1
       > scons: building terminated because of errors.
       > build/nixos/mongo/db/query/analyze_regex.o failed: Error 1
       For full logs, run 'nix log /nix/store/k5h9y3g5gs1r54wihhwpg1hi32yw7jp9-mongodb-6.0.12.drv'.
domenkozar commented 2 months ago

Do you know if mongodb is fixed now?

samjwillis97 commented 2 months ago

I'm not sure.. I just had a quick look through nixpkgs issues and couldn't see any talk around mongodb 6 being broken, but it was bumped from 6.0.12 to 6.0.13 just 5 days ago

domenkozar commented 2 months ago

Could you rebase, maybe it will finally build :)

samjwillis97 commented 2 months ago

We can only hope at this point 🤞

domenkozar commented 2 months ago

@samjwillis97 is seems like you'll need to run pre-commit run -a