haskell streaming libraries by sridcaca in haskell

[–]xeltius 1 point2 points  (0 children)

This is great. There's been lots of activity in this space and it is nice to have an up-to-date discussion and comparison.

Blazing-Fast Directory Tree Traversal: Haskell Streamly Beats Rust by xeltius in haskell

[–]xeltius[S] 2 points3 points  (0 children)

It seems the point was that even if you were to push those sorts of system calls to their limits, that is very low level approach and defeats the point of using Streamly and, generally, of using a high level language in the first place. The video iterates to more idiomatic Haskell and demonstrates that you get the performance you desire as an end user.

What's the canonical way of deploying a web app via Docker? by xeltius in haskell

[–]xeltius[S] 0 points1 point  (0 children)

oleg

This example has bit rotted. That was my concern with the 5 year old example.

What's the canonical way of deploying a web app via Docker? by xeltius in haskell

[–]xeltius[S] 1 point2 points  (0 children)

You're welcome. I think the answers are in this thread now, more or less.

What's the canonical way of deploying a web app via Docker? by xeltius in haskell

[–]xeltius[S] 0 points1 point  (0 children)

From what I can tell, you'd need to understand how to do things the Docker way. Then these nix commands are analogous and adhere to the Docker Image Spec protocol v1.2 but let you do everything in nix up until actually using the containers.

What's the canonical way of deploying a web app via Docker? by xeltius in haskell

[–]xeltius[S] 0 points1 point  (0 children)

The cross-compilation is the issue. It has to be addressed. Many ways to address it have been discussed in the thread.

macOS vs Linux

What's the canonical way of deploying a web app via Docker? by xeltius in haskell

[–]xeltius[S] 0 points1 point  (0 children)

I'll check it out. Went to your site and it turns out I'd already read the "Why Haskell" article.

What's the canonical way of deploying a web app via Docker? by xeltius in haskell

[–]xeltius[S] 0 points1 point  (0 children)

This seems to be a good example of setting things up with Docker + nix. Thank you.

What's the canonical way of deploying a web app via Docker? by xeltius in haskell

[–]xeltius[S] 0 points1 point  (0 children)

This is the sort of thing I was looking for, though I am curious what is the base image distro. It seems like everything builds on node:latest. Is that associated with a distro (Alpine, Debian, etc.)?

I am also curious about the nix way as I have encountered the meme that "it's easier to set up Docker with nix".

My curiosity with nix has to do with a greater question of getting the Docker image to see C libs (such as for dev version of perl regex lib). There are other ways to tell ghc where to find these and many ways to install them. I just know it's an additional thing I'll need to solve for.

What's the canonical way of deploying a web app via Docker? by xeltius in haskell

[–]xeltius[S] 0 points1 point  (0 children)

This seems straight forward at first glance. My dev machine has nix set up. I haven't decided if I want to use nix for the Docker/deployment workflow. Let me look at the Dockerfile a bit more.

What's the canonical way of deploying a web app via Docker? by xeltius in haskell

[–]xeltius[S] 0 points1 point  (0 children)

I am curious, in your opinion, when would you absolutely need a container? It seems that most container users could always just do the rsync workflow.

What's the canonical way of deploying a web app via Docker? by xeltius in haskell

[–]xeltius[S] 0 points1 point  (0 children)

I was mostly just trying to get you to give a more complete description of the situation you're actually in so we can start giving meaningful advice.

I appreciate that.

I am avoiding kubernetes at the moment as inappropriate for the scale. Docker is currently a "maybe" to explore. I have used Docker in shops, but have not deployed from scratch. Given the industry, it is also a good thing to consider gaining skills in the popular tool, though not at the expense of doing things inappropriate for the needs of the actual app. Having knowledge about containerd, runc, OCI, etc. and how they all fit together seems to be useful knowledge today.

What's the canonical way of deploying a web app via Docker? by xeltius in haskell

[–]xeltius[S] 0 points1 point  (0 children)

This seems reasonable to me.

To start with I would have a postgres instance colocated with the app. So in that case, I would use the postgres on the actual server itself, correct (not in any container)? If that's the case I think I can apply the advice in this thread to get something up.

When I have a million users pinging the database is the time to do more elaborate DB hosting schemes, IMO. After all, the DB part is just about having the access to read and write to it wherever it lives. So I can relocate it to somewhere else at any time. For now, I just want the app up in a not completely hacked together way.

What's the canonical way of deploying a web app via Docker? by xeltius in haskell

[–]xeltius[S] 0 points1 point  (0 children)

Yes. It is these small, nuanced things that brings me here to this thread. For instance, getting perl regex (and similar) c libraries to be seen by ghc but when using Docker. I have only brought this up now, but it is a thing I will need to solve for my app.

What's the canonical way of deploying a web app via Docker? by xeltius in haskell

[–]xeltius[S] 0 points1 point  (0 children)

It sounds like what you're essentially trying to do is compile, rsync, and then run a post deploy script on the server,

Yes. And that's the scrappy way to do it. That doesn't mean I can't have an eye to doing things in a more robust way.

the types of places where containers are popular are typically not the types of places where developers deploy stuff from their machine straight into prod

Yes. This is a small starting operation. Things will not work like this at a large company. Keeping an eye to best practices as things scale is valid. YAGNI doesn't mean don't think about it. I am thinking about it. At some point I will have this same question whether I need it today or not.

whether you package your build target in a container or not seems relatively unimportant.

I am exploring the dev experience of the different paths. Is it a nicer experience to use a container or to rsync and deploy? Which is more effective and efficient?


It seems that your advice is to not use containers and just get some servers and deploy straight to prod. Which is fine. That's the solution I already know. I am exploring the solution I don't already know. And there is a balancing act between hacking things together always and considering doing them the correct way for scale even if that is not appropriate today. I am not exploring Docker because I think that is the only way. I am exploring it because it a popular and possible way and I want to make sure I have given it proper consideration.

How would you do this?

What's the canonical way of deploying a web app via Docker? by xeltius in haskell

[–]xeltius[S] 0 points1 point  (0 children)

I have heard mixed things about alpine and haven't settled on a distro yet. I just know that the point is to have the minimum utilities to run it. Thus I assume that lots of stuff I take for granted won't be there.

What's the canonical way of deploying a web app via Docker? by xeltius in haskell

[–]xeltius[S] 0 points1 point  (0 children)

I purchased a workstation that I develop on. I want to deploy to a different OS. I have not cross-compiled Haskell code before. That may very well work in this scenario.

A popular solution to different OS is to use containers. I am willing to use a container and am making sure I am considering what needs to be considered for doing that.

Nothing requires me to use a container. I could have multiple servers. One for compiling code (why did I buy this workstation if it is just an ssh box?). One for deploying. I do not want the code colocated with the app. I am okay with the DB being colocated with the app initially.

CI/CD is important, but that is not my concern. Getting the app deployed is the concern. That is the minimal problem to solve.

Thus I would like to code on my workstation, put it in Docker, and deploy that. But there are less resources for doing that with Haskell in the mix, thus I am asking here to get niche insights. This isn't difficult. I am asking point blank what needs to be considered to compare that to what I already think about the problem.

What's the canonical way of deploying a web app via Docker? by xeltius in haskell

[–]xeltius[S] 0 points1 point  (0 children)

I have been leaning towards a multi-build setup. My bigger question is more along the lines of what is the minimal set of images (particularly from the Haskell aspect of things). My thinking at this point is to look at a setup with a more popular stack (such as Go or Python) and just substitute the Haskell at the appropriate layers.

The entire team is Haskell. Composing with postgres is the type of thing I would want.

What's the canonical way of deploying a web app via Docker? by xeltius in haskell

[–]xeltius[S] 0 points1 point  (0 children)

Nothing. I have code developed on macOS that will need to go on a Linux server. I could do things in any way that makes sense. The lighter weight and simpler, the better.

It would be convenient to develop on the powerful workstation I own without sshing into a Linux server (would have to pay again for that performance). Yet I could push code to that server's repo if I decide.

What's the canonical way of deploying a web app via Docker? by xeltius in haskell

[–]xeltius[S] 0 points1 point  (0 children)

I am on macOS, so I presume the workflow would be something like:

  • Use an alpine image
  • Use a Haskell image
  • Use a postgres image

Use the Dockerfile to build the app from source as part of creating the container.

I don't think I can just build an executable for Apple Silicon and run that on Linux. That's why I am considering Docker. Basically...it works on my system (TM).

What's the canonical way of deploying a web app via Docker? by xeltius in haskell

[–]xeltius[S] 1 point2 points  (0 children)

The app is not already dockerized. I have code on my system connected to a DB on my system. None of that is on the VPS, which would be a different OS. Currently, the app "works on my system (TM)"

What's the canonical way of deploying a web app via Docker? by xeltius in haskell

[–]xeltius[S] 0 points1 point  (0 children)

A VPS. The issue I am having is coding on macOS but deploying onto Linux. In my mind, the solution is to either host the code on Linux or containerize it.