Progress on migrating to Rescript

Basically it will give you the power to self-administer a lot of the change. The guardians will be there to help you out, as well as well as @ErikSchierboom and Jeremy will be around.

For now the PR with the new exercise template is ready.

It is ready to be used for new exercises.
Let’s start there and then we can later figure out how to migrate the actual exercises and the test runner to support the new toolchain.

If anyone feels compelled to review please do :grin:

Not exactly sure how to do the migration for existing exercises without breaking the existing solutions, but let’s take it step by step.

Also added this reasonml-test-runner PR for the test-runner. Just trying to get things up to date before adding more changes

1 Like

A bit more updates on this topic:

On one of the PRs to enable the ReasonML Test Runner to support running Melange-based exercises, the docker image size for the test runner has increased quite a lot.

On my local env, the image size has gone from ~500MB to ~2GB.
The main jump is because it needs to have both ocaml + node.
It is definitely a big jump and we will definitely try to make some improvements to reduce the size.

For now, are there any adverse effects this could have for example on costs or could there be anything else that we should consider?
cc @iHiD

This definitely affects costs :slight_smile: The question is, how much?

Eep, that’s a lot. Have you looked over Best Practices | Exercism's Docs and seen if anything there might help? Exercism uses a handful of test runner machines in the cloud, and each machine is loaded with over 75+ test runner images at this point. Every megabyte shaved would save us $$ on a yearly basis.

1 Like

It might be a good idea to revert that PR until Jeremy can sign off on the size increase.

1 Like

Thanks. I hadn’t seen that doc before.

Will definitely look at it and see what improvements can be made.

Sure.

That’s quite a dramatic increase in size and thanks for flagging it.

Here’s the Revert PR: Revert "Add exercises based on Melange toolchain" by kevgathuku · Pull Request #40 · exercism/reasonml-test-runner · GitHub

1 Like

Is it 500MB without node?

It was 500mb originally, with node

1 Like

I reworked the ocaml image for 2 years ago, you could take a look at that one. I think I got it down to like 600 MB, and adding node to that should bring the total to 700 MB. Something I have learnt is that there is usually a way around docker problems aslong as you are willing to figgel with it a bit. I need to double check how small I got the image to be, but will check again.

2 Likes

Right, so opam is the package manager I assume and here adds 1.5 GB, right by installing dune reason melange melange-jest?

1 Like

Most of it should be coming from actually installing ocaml. I don’t think the packages are that big

I reworked the ocaml image for 2 years ago, you could take a look at that one. I think I got it down to like 600 MB, and adding node to that should bring the total to 700 MB.

Thanks @Meatball will take a look :eyes:
Moving to alpine should be a quick win with trimming down the size, but will check further.

1 Like

I realized there has been changes after I worked on it. So it is larger but I can get an image of ocaml (+ a lot of libraries) and node to 1,6 gb. So I think you could save atlest a few hundred mb at least.

There is a lts-alpine, in case that’s what you wanted. Only 53.43 MB.

2 Likes

I am not sure but it might be better to do it the other way around. And use an ocaml image and then add node on that. But I am note 100% sure.

I checked, (and I did not find /) there is no good up-to-date node ocaml. We’d have to make it.

Trying this approach.

Starting from ocaml and installing node should be easier in theory but let’s see what happens in real life :joy:

1 Like

As an aside, this is a nice reminder I should take a closer look at the Racket test runner image. It’s pretty lean at the moment since we’re using the non-standard minimal Racket installation. The full base installation has a lot of GUI dependencies due to the integrated DrRacket editor, but they’ve done away with some of those so it might not be too bad.

2 Likes

I tried it myself, and I get it to 2gb. The melange library seems to be rather large.

2 Likes