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

Math worker updates & fixes #1060

Merged
merged 19 commits into from
Jul 13, 2021
Merged

Math worker updates & fixes #1060

merged 19 commits into from
Jul 13, 2021

Conversation

metasoarous
Copy link
Member

  • updating system to clojure-cli/deps.edn toolchain
  • fixing dev tooling for stopping/restarting system components
  • docker compose dev infrastructure for to start poller with an nREPL process for jacking in to math worker process
  • update math README to reflect the above

@willcohen
Copy link
Contributor

This is awesome. I'll try out the docker workflow in the next few days if that's okay, but in terms of changes -- this all looks excellent from a pure code review!

@metasoarous
Copy link
Member Author

Great! Thanks so much @willcohen.

I'll go ahead and accept your code review as sufficient for merging purposes. But please do give the docker workflow a try when you get a chance, and feel free to open another issue if any friction arises.

Thanks again!

@metasoarous metasoarous merged commit 5ba1895 into dev Jul 13, 2021
@willcohen
Copy link
Contributor

@metasoarous just as a quick update on this:

Docker Desktop very much does not get along with my slightly older MacBook Pro, making development that way tricky. I'm currently navigating the (for me) uncharted waters of podman, and will likely propose a PR that provides a parallel dev environment process using a podman image build script + (mini)kube yml rather than docker-compose directly!

raulsperoni pushed a commit to proyectourgente/polis that referenced this pull request Sep 1, 2021
@willcohen
Copy link
Contributor

@metasoarous quick question about docker-compose and the math worker, since I'm having some trouble connecting (and to be clear, docker is pretty new to me).

I can get polis to start up with docker-compose up --detach as noted in the README, and can see it on localhost:5000 (this is via podman and some port forwarding still isn't quite working for me).

Is the idea that setting up the repl means using docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --detach instead?

When I do this, I see that polis-math runs and exposes port 18975. If I try to connect to that repl, the connect fails and the service quits with an exit 1 error.

Here's what I see with docker-compose logs:

polis-math              | WARNING: Specified aliases are undeclared and are not being used: [:dev-poller]
polis-math              | No function found on command line or in :exec-fn

It's entirely possible this is just a RAM issue and I just need to make it a little bigger -- if I figure out what's going on in the meantime, I'll let you know.

@metasoarous
Copy link
Member Author

Hey @willcohen! Thanks for trying this out. We've had issues with folks getting development environment working on older/smaller machines, so it's great to have some attention in this direction.

Is the idea that setting up the repl means using docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --detach instead?

Yes, this should fire up the REPL and expose the corresponding port. It will also soon set up some dev time conveniences for the server/js code, once the typescript branch is merged (see #960).

Here's what I see with docker-compose logs:

This doesn't look like a RAM issue to me. It looks like it's not finding the deps.edn for some reason, which is where the :dev-poller alias is defined. If you're somehow using docker-compose with podman (curious how you're doing that, btw), my guess is that podman may not be correctly setting the working directory, which would cause it to run that command from the root of the project directory, instead of from the math directory.

@patcon has overcome memory issues in the past running with docker machine. That may be something to look into as well. The dev time utilities are to my knowledge untested there (port forwarding etc), so there may be some dragons to slay around that path, but it's another thing to try if RAM is an issue.

Thanks again!

@willcohen
Copy link
Contributor

Sounds good. This will likely take a few weeks to fully resolve on my environment due to waiting for podman things upstream. Long story short podman can now listen to a socket and it implements the docker API, and it recently added support via QEMU to transparently boot up a Linux VM on Mac, all of which means it’s largely drop-in compatible for the purposes of docker compose. Pending a couple of upstream changes mentioned in #1135, a couple of changes to the dockerfile about short name resolution, and potentially some changes based on what you mentioned above, eventually this should work with the docker compose workflow, be more lightweight, and work on Mac, Linux, and maybe Windows. From there I may even be able to finally get into this math worker!

@metasoarous
Copy link
Member Author

Excellent!

Is the idea behind podman that it can run things without the overhead of a bunch of containers? Seems like running things in a virtual machine would consume more resources, not less. But maybe I'm missing part of the picture.

I wonder if your problem is really on the build side, where it does take quite a toll on local resources to get the containers set up. @patcon @ballPointPenguin Wasn't there a setting that we used to help get some folks set up who were short on hard drive space for building their containers? That may not help us here, but thought I'd check to see if you have related ideas.

Thanks again

@willcohen
Copy link
Contributor

Ah! Yes — a VM would be worse on linux, but it’ll always be needed on macOS, even for docker. The main difference for me is just that Docker Desktop for Mac has a pretty heavy semi-mandatory GUI + something about a recent update broke on my Big Sur install and I haven’t been able to get Docker running for months, so the idea of a CLI replacement sidestepping all of that was appealing. On Linux native I’m pretty sure it and Docker and kube all basically run the same few shared things behind the scenes. The build seemed like it worked okay — I was able to get an overall environment running and make a user etc. I don’t want to send anyone on a goose chase just yet before I do a little more diagnosing on this end, and I do feel like fundamentally this should work. I’ll poke around some more with working directories and the rest. I feel pretty good on my JVM and Clojure chops, but managing containers has always been hard for me…

@metasoarous
Copy link
Member Author

Great; Thanks for explaining your situation in greater detail @willcohen.

I guess I always assumed that as a 'nix type system, OSX was able to take advantage of the same chroot magic behind docker for Linux, but perhaps I don't have a full/accurate picture of the details there.

In any case, please feel free to go whatever route feels most productive for you.

raulsperoni pushed a commit to proyectourgente/polis that referenced this pull request Oct 26, 2021
raulsperoni pushed a commit to proyectourgente/polis that referenced this pull request Oct 26, 2021
@metasoarous metasoarous deleted the math-worker-fixes branch October 18, 2022 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants