adoptingerlang / adoptingerlang Goto Github PK
View Code? Open in Web Editor NEWAdopting Erlang is an ongoing effort to gather all the resources that will help you use Erlang in a business
Home Page: https://adoptingerlang.org
License: Other
Adopting Erlang is an ongoing effort to gather all the resources that will help you use Erlang in a business
Home Page: https://adoptingerlang.org
License: Other
If you are in the Docker chapter and you click next, you go straight to Team Building, whereas it should be Kubernetes.
Also thank you for your time, this book is very valuable for experienced newcomers.
There's a reference in the Releases chapter to docker-compose up
running database migrations, but this is never revisited later in the chapter nor in the next chapter dedicated to Docker.
Is this something that's in the works? It would be really helpful! The topic of database migrations in the context of Docker and "the cloud" in general is not getting enough attention in any of the deployment tutorials I was able to find. I.e. what are some of the "best practices" around this? In the context of a single container deployment? What about multiple containers? Should migrations be run on start-up by the application itself vs delegated to external tools? Etc. etc.
Thanks again for writing this book!
5th of December 2022
If these instructions save anyone else out there from going down the rabbit hole I went down in trying to build the Adopting Erlang eBooks from source, I will gladly provide them!
The first thing you should know is that the instructions for the Emacs build process are correct – see the README.md file here:
[](https://github.com/adoptingerlang/adoptingerlang
I didn’t get as far as generating the Hugo website, such was not my interest or need, but I assume that will work.
For those who are unfamiliar with Emacs, (I myself am more of a Vim guy), you might find these instructions helpful:
However, on OpenSUSE Tumbleweed, the instructions for the LaTeX build simply do not work at all! I managed to kludge it by fiddling around with the command line arguments, but the resulting PDF was not satisfactory, in that the Table of Contents and internal references were not working properly. Also, I could not create EPUB or MOBI versions of the book at all!
OpenSUSE comes with a barebones installation of LaTeX; however, the texlive dependencies you will need are not installed by default. You will need to install various other dependencies as well.
The first step is to install these:
> sudo zypper in texlive-collection-fontsextra texlive-collection-latexextra texlive-scheme-tetex texlive-cyrillic texlive-pmboxdraw texlive-fncychap texlive-lwa tidy rubber calibre emacs
Expect this step to take several hours, depending on the speed of your network and computer. The texlive dependencies are big!
Then run the Emacs project Tex file build procedure. (First link above.)
Then, to build the PDF:
> pdflatex --shell-escape adoptingerlang.tex
Run this command several times until you stop getting warnings to run it again. (Note that I got warnings about missing includes which I was unable to resolve, however, this does not seem to have materially affected the end result.)
Or, to build the PDF in one step:
> rubber --shell-escape --pdf adoptingerlang
Build the EPUB:
> tex4ebook -s -f epub3 adoptingerlang.tex
Build the MOBI:
> tex4ebook -s -f mobi adoptingerlang.tex
Viola, you’re done! QED!
Adopting.Erlang–Build.Instructions.Linux.pdf
A PDF version of these instructions is attached.
In https://adoptingerlang.org/docs/development/otp_applications/#what-makes-a-lib-an-app there is a link to a configuration chapter ((see the Configuration chapter)
), but gives 404.
We might want to aim for a first public release that contains basic content, to gather feedback and build a kind of readership as we then publish more and more stuff over time.
This issue contains tasks we'd have to cover:
On the Development/OTP Applications page, the URL for the "Next" link at the bottom of the page appears to be incorrect. When I click on it, I'm sent to a 404 page. Clicking on the link for the following page listed in the Contents at the left-hand side of the page works fine, however.
It looks like the offending hyperlink doesn't point into the Development folder. Compare the broken one: https://adoptingerlang.org/docs/supervision_trees to the working one: https://adoptingerlang.org/docs/development/supervision_trees/ (both taken from https://adoptingerlang.org/docs/development/otp_applications/)
"...which relies on the cache’s ETS table and that table vanishes, then all these processes will may together."
We've found that the suggested multi-stage Dockerfile has problems when it comes to multi-architecture builds. The book suggest to use cache mounts with the attribute sharing=locked
(which to my understanding prevents multiple writers to the cache simultaneously, but will always use the cache eventually):
RUN --mount=id=hex-cache,type=cache,sharing=locked,target=/root/.cache/rebar3 \
rebar3 compile
However, when trying to make multi-architecture builds with Alpine as a base image this problem occurs:
$ docker buildx build --file ./Dockerfile --platform linux/arm64,linux/amd64 --ssh default=$SSH_AUTH_SOCK --tag project .
=> CACHED [linux/amd64 runner 2/4] WORKDIR /opt/project/ 0.0s
=> ERROR [linux/amd64 runner 3/4] RUN --mount=type=cache,id=apk,sharing= 3.6s
=> CACHED [linux/arm64 runner 2/4] WORKDIR /opt/project/ 0.0s
=> [linux/arm64 runner 3/4] RUN --mount=type=cache,id=apk,sharing=locked 3.3s
=> [linux/arm64 builder 4/6] COPY rebar.config rebar.lock ./ 0.0s
=> CANCELED [linux/arm64 builder 5/6] RUN apk add --no-cache openssh-cli 0.9s
------
> [linux/amd64 runner 3/4] RUN --mount=type=cache,id=apk,sharing=locked,target=/var/cache/apk ln -s /var/cache/apk /etc/apk/cache && apk add --update libstdc++ openssl ncurses:
#0 3.539 WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.16/main: UNTRUSTED signature
#0 3.540 WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.16/community: UNTRUSTED signature
#0 3.543 ERROR: unable to select packages:
#0 3.543 libstdc++ (no such package):
#0 3.546 required by: world[libstdc++]
#0 3.546 ncurses (no such package):
#0 3.546 required by: world[ncurses]
#0 3.546 openssl (no such package):
#0 3.546 required by: world[openssl]
------
WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
Dockerfile:79
--------------------
78 | # openssl needed by the crypto app
79 | >>> RUN --mount=type=cache,id=apk,sharing=locked,target=/var/cache/apk \
80 | >>> ln -s /var/cache/apk /etc/apk/cache && \
81 | >>> apk add --update \
82 | >>> libstdc++ \
83 | >>> openssl \
84 | >>> ncurses
85 |
--------------------
ERROR: failed to solve: process "/dev/.buildkit_qemu_emulator /bin/sh -c ln -s /var/cache/apk /etc/apk/cache && apk add --update libstdc++ openssl ncurses" did not complete successfully: exit code: 3
I'm not sure exactly what the problem is, but we suspected some cache contamination between architectures. If we change the flag to sharing=private
(which to my understanding will re-use the cache if no-one is using it, but create a new one instead of waiting for a locked one) it works.
See more information here https://docs.docker.com/engine/reference/builder/#run---mounttypecache
Note that we only had to change the sharing
flag to private
for the lines involving apk
.
I'd be happy to do a PR and updating this section with explanations if we agree that this is the proper fix to the problem.
It seems like all/many the links with <a href="">
are incorrect. For example the link to systools in: https://adoptingerlang.org/docs/production/docker/#multi-stage-build
I think they should be [[link][target]]
or something like that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.