..:: AsmBB ::..: Docker support?
<img src="https://board.asm32.info/images/title.svg" alt="Title img">
<h1>AsmBB is ultrafast web forum, written entirely in assembly language. This site is the official support development forum and demo/test installation.</h1>
tag:board.asm32.info,2018-03-06:Thread2562019-01-24T09:29:29Zjohnfound on Docker support?tag:board.asm32.info,2018-03-06:Post157452019-01-24T09:29:29Z
<blockquote><header>logicfish</header><blockquote><header>johnfound</header><p>... And what are the advantages (and disadvantages) of this approach.
</p>
<p>Honestly, it seems to be an over-complicated way to run nginx+asmbb. But it is probably my ignorance. <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/smile.gif" alt=":-)" />
</p></blockquote>
<p>I would say that the obvious advantages are, being able to run asmbb on the cloud, and also on non-x86 systems.
Also, you could run on a stripped down kernel, and you would be able to run this very cheaply on a cloud VM - especially if you used rwasa.
</p>
</blockquote>
<p>Well, running on non-x86 is possible, but definitely totally pointless. But well, maybe you are right about running on some ultralight stripped down kernel on a cloud. I simply know almost nothing about such technologies. <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/smile.gif" alt=":-)" /> </p>
johnfoundlogicfish on Docker support?tag:board.asm32.info,2018-03-06:Post157442019-01-23T21:52:28Z
<blockquote><header>johnfound</header><p>... And what are the advantages (and disadvantages) of this approach.
</p>
<p>Honestly, it seems to be an over-complicated way to run nginx+asmbb. But it is probably my ignorance. <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/smile.gif" alt=":-)" />
</p></blockquote>
<p>I would say that the obvious advantages are, being able to run asmbb on the cloud, and also on non-x86 systems.
Also, you could run on a stripped down kernel, and you would be able to run this very cheaply on a cloud VM - especially if you used rwasa.
</p>
logicfishjohnfound on Docker support?tag:board.asm32.info,2018-03-06:Post157212018-12-04T07:35:45Z
<blockquote><header>ganuonglachanh</header><p>I attached it below and you can use it as a starter guide for users who want to try AsmBB with Docker <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/wink.gif" alt=";-)" />
</p></blockquote>
<p>Thanks. It works for me too.
</p>
<p>Maybe you will write later some short tutorial explaining step-by-step how to install and manage AsmBB with Docker? And what are the advantages (and disadvantages) of this approach.
</p>
<p>Honestly, it seems to be an over-complicated way to run nginx+asmbb. But it is probably my ignorance. <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/smile.gif" alt=":-)" /> </p>
johnfoundganuonglachanh on Docker support?tag:board.asm32.info,2018-03-06:Post157202018-12-04T02:02:36Z
<blockquote><header>johnfound</header><p>Well, I have some results now.
</p>
<p>But I am confident, that this very API call can't bring any security issues. And I am not very sure why it is excluded from the default security profile of Docker. It actually switches the address space of a 32bit program to 3GB (instead of 4GB by default).
</p></blockquote>
<p>Thank you very much johnfound
</p>
<p>I edited my Asmbb docker with your suggestions and it worked <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/rofl.gif" alt="rofl" />
</p>
<p>I attached it below and you can use it as a starter guide for users who want to try AsmBB with Docker <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/wink.gif" alt=";-)" />
</p>
ganuonglachanh johnfound on Docker support?tag:board.asm32.info,2018-03-06:Post157192018-12-03T18:57:03Z
<p>Well, I have some results now.
</p>
<p>The problem is actually that the program running in docker can't use the kernel API <code>personality</code> with the needed options.
</p>
<p>There are different solutions to this issue. First to include the following option in the <code>docker-compose.yml</code>:
</p>
<pre><code class=""> security_opt:
- seccomp:unconfined
</code></pre>
<p>This solution works (I was able to run AsmBB this way) but it is not the best solution, because it allows all kernel API to be exposed to the container (some are usually disabled for security reasons).
</p>
<p>The second option is to allow only the needed <code>personality</code> options by changing the docker security profile.
</p>
<p>This procedure (not very clear for me) is described <a href="https://docs.docker.com/engine/security/seccomp/#pass-a-profile-for-a-container">here</a>.
</p>
<p>The default <code>.json</code> profile is <a href="https://github.com/moby/moby/blob/master/profiles/seccomp/default.json">here</a> and there are several elements with the allowed variants of <code>personality</code>. One more have to be added:
</p>
<pre><code class="">{
"names": [
"personality"
],
"action": "SCMP_ACT_ALLOW",
"args": [
{
"index": 0,
"value": 134217736,
"valueTwo": 0,
"op": "SCMP_CMP_EQ"
}
],
"comment": "",
"includes": {},
"excludes": {}
}
</code></pre>
<p>But as I already said this second procedure is a little bit out of my competence and understanding...
</p>
<p>But I am confident, that this very API call can't bring any security issues. And I am not very sure why it is excluded from the default security profile of Docker. It actually switches the address space of a 32bit program to 3GB (instead of 4GB by default).</p>
johnfoundganuonglachanh on Docker support?tag:board.asm32.info,2018-03-06:Post157172018-12-03T16:05:42Z
<blockquote><header>johnfound</header><blockquote><header>ganuonglachanh</header><p>So my guest is ./engine is <strong>not work in docker environment</strong> (had 100% CPU usage for 1 core) <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/cry.gif" alt=":'-(" />
No <em>engine.sock</em>, No <em>asmbb_ipc.bin</em>, NO <em>board.sqlite</em> were created!
</p></blockquote>
<p>It should work. I can't see any reasons to not work actually... Maybe it is some kind of bug related to the docker architecture...
</p>
<p>Will probably try to install docker and make some tests...
</p></blockquote>
<p>Hi, good to here you are interested in docker <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/rofl.gif" alt="rofl" />
</p>
<p>I attached my test docker-compose for you. It is pretty simple to get start. Make sure you check to source code of it first, just text, no binary.
</p>
<p>1. install docker and docker compose (google tutorial for your Linux distro)
</p>
<p>2. <strong>cd to asmbb, which have the docker-compose.yml</strong>
</p>
<p>3. run command: <code>docker-compose up -d</code>
</p>
<p>4. to get to bash of docker machine:
</p>
<p><code>docker exec -it asmbb_ubuntu /bin/bash</code>
</p>
<p>5. play around:
</p>
<p><code></code>
</p>
<p>start nginx: nginx &
</p>
<p><strong>cd / var / www/html</strong>
</p>
<p>./engine
</p>
<p>log file: <em>var</em>log/nginx/
nginx conf file: <em>etc</em>nginx/ and <em>etc</em>nginx/sites-enabled/
</p>
<p><code></code>
</p>
<p>I don't now how to debug asm in this docker machine, so just install tools like real machine and you are good to go.
</p>
<p>6. to stop docker: <code>docker-compose stop</code>
</p>
<p>7. to re-create docker machine : <code>docker-compose down</code> then <code>docker-compose up -d</code>
</p>
<p>Have fun <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/rofl.gif" alt="rofl" /> </p>
ganuonglachanh johnfound on Docker support?tag:board.asm32.info,2018-03-06:Post157142018-12-03T14:42:17Z
<blockquote><header>ganuonglachanh</header><p>So my guest is ./engine is <strong>not work in docker environment</strong> (had 100% CPU usage for 1 core) <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/cry.gif" alt=":'-(" />
No <em>engine.sock</em>, No <em>asmbb_ipc.bin</em>, NO <em>board.sqlite</em> were created!
</p></blockquote>
<p>It should work. I can't see any reasons to not work actually... Maybe it is some kind of bug related to the docker architecture...
</p>
<p>Will probably try to install docker and make some tests...</p>
johnfoundganuonglachanh on Docker support?tag:board.asm32.info,2018-03-06:Post157102018-12-03T14:28:50Z
<blockquote><header>johnfound</header><blockquote><header>ganuonglachanh</header><p>Hi, I'm trying to install with Docker, since it is not fully support systemd, can we use it with supervisord ? Any tutorial setting would be appreciated
</p>
<p>And with Docker when I run./engine to test, the CPU usage increase and it still failed to access the board in webbrowser (setting in nginx conf is done as the guide)
</p></blockquote>
<p>Systemd is not required for AsmBB. In my setup it is used only for running <code>./engine</code> at the server startup. Also to restart on crashes, but AsmBB never crash actually. <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/wink.gif" alt=";-)" />
</p>
<p>Anyway if there is no systemd, you can run <code>engine</code> in arbitrary way. It only needs to be started.
</p>
<p>On the other hand, the CPU usage should not increase when <code>engine</code> is running, but not used. Maybe only for few milliseconds when AsmBB opens the database and create the sockets.
</p>
<p>Does the engine create the database file on the first run? ( <code>asmbb/board.sqlite</code> )
</p>
<p>Does the engine create the socket on startup? ( <code>asmbb/engine.sock</code> )
</p>
<p>Does the engine create the IPC shared memory file? ( <code>asmbb/asmbb_ipc.bin</code> )
</p>
<p>What is the user that runs <code>engine</code>? What are the user permissions for the <code>asmbb/</code> directory? It needs to have writing permissions there.
</p>
<p>What returns nginx on the requests?
</p></blockquote>
<p>Hi, I tried install in Virtual Box with Ubuntu then it worked! <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/rofl.gif" alt="rofl" />
So my guest is ./engine is <strong>not work in docker environment</strong> (had 100% CPU usage for 1 core) <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/cry.gif" alt=":'-(" />
No <em>engine.sock</em>, No <em>asmbb_ipc.bin</em>, NO <em>board.sqlite</em> were created!
</p>
<p>So with Virtual Box (*full* OS virtualization) it worked, but with Docker/Docker-compose (*semi* virtualization) it won't work <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/sad.gif" alt=":-(" /> </p>
ganuonglachanh johnfound on Docker support?tag:board.asm32.info,2018-03-06:Post157092018-12-03T08:09:50Z
<blockquote><header>ganuonglachanh</header><p>Hi, I'm trying to install with Docker, since it is not fully support systemd, can we use it with supervisord ? Any tutorial setting would be appreciated
</p>
<p>And with Docker when I run./engine to test, the CPU usage increase and it still failed to access the board in webbrowser (setting in nginx conf is done as the guide)
</p></blockquote>
<p>Systemd is not required for AsmBB. In my setup it is used only for running <code>./engine</code> at the server startup. Also to restart on crashes, but AsmBB never crash actually. <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/wink.gif" alt=";-)" />
</p>
<p>Anyway if there is no systemd, you can run <code>engine</code> in arbitrary way. It only needs to be started.
</p>
<p>On the other hand, the CPU usage should not increase when <code>engine</code> is running, but not used. Maybe only for few milliseconds when AsmBB opens the database and create the sockets.
</p>
<p>Does the engine create the database file on the first run? ( <code>asmbb/board.sqlite</code> )
</p>
<p>Does the engine create the socket on startup? ( <code>asmbb/engine.sock</code> )
</p>
<p>Does the engine create the IPC shared memory file? ( <code>asmbb/asmbb_ipc.bin</code> )
</p>
<p>What is the user that runs <code>engine</code>? What are the user permissions for the <code>asmbb/</code> directory? It needs to have writing permissions there.
</p>
<p>What returns nginx on the requests?</p>
johnfoundganuonglachanh on Docker support?tag:board.asm32.info,2018-03-06:Post157082018-12-03T07:53:20Z
<blockquote><header>johnfound</header><blockquote><header>ganuonglachanh</header><p>Hi John
</p>
<p>I'm trying to install AsmBB with Docker, still not sucessful. Does anyone success with Docker? It will be awsome if AsmBB goes with Alpine Linux in Docker or Docker-compose <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/rofl.gif" alt="rofl" /> It will be supper fast and lightweight <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/wink.gif" alt=";-)" />
</p></blockquote>
<p>I know absolutely nothing about Docker. Only that it is somehow related to virtualization... So, I can be of very little help about the Docker issues.
</p>
<p>In order to have AsmBB working you need several conditions:
</p>
<p>1. 32 or 64bit x86 CPU.
2. Linux
3. Running web server supporting FastCGI and properly tuned to send all the requests to AsmBB engine.
4. Running AsmBB engine.
</p>
<p>What actually is not working in your attempts?
</p></blockquote>
<p>Hi, I'm trying to install with Docker, since it is not fully support systemd, can we use it with supervisord ? Any tutorial setting would be appreciated
</p>
<p>And with Docker when I run./engine to test, the CPU usage increase and it still failed to access the board in webbrowser (setting in nginx conf is done as the guide)</p>
ganuonglachanh johnfound on Docker support?tag:board.asm32.info,2018-03-06:Post157072018-12-03T07:30:22Z
<blockquote><header>ganuonglachanh</header><p>Hi John
</p>
<p>I'm trying to install AsmBB with Docker, still not sucessful. Does anyone success with Docker? It will be awsome if AsmBB goes with Alpine Linux in Docker or Docker-compose <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/rofl.gif" alt="rofl" /> It will be supper fast and lightweight <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/wink.gif" alt=";-)" />
</p></blockquote>
<p>I know absolutely nothing about Docker. Only that it is somehow related to virtualization... So, I can be of very little help about the Docker issues.
</p>
<p>In order to have AsmBB working you need several conditions:
</p>
<p>1. 32 or 64bit x86 CPU.
2. Linux
3. Running web server supporting FastCGI and properly tuned to send all the requests to AsmBB engine.
4. Running AsmBB engine.
</p>
<p>What actually is not working in your attempts?</p>
johnfoundganuonglachanh on Docker support?tag:board.asm32.info,2018-03-06:Post157042018-12-03T06:02:34Z
<p>Hi John
</p>
<p>I'm trying to install AsmBB with Docker, still not sucessful. Does anyone success with Docker? It will be awsome if AsmBB goes with Alpine Linux in Docker or Docker-compose <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/rofl.gif" alt="rofl" /> It will be supper fast and lightweight <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/wink.gif" alt=";-)" /> </p>
ganuonglachanh