Warning of unannounced forum closure

Here you can talk about anything related to BBC BASIC, not covered in another category
Hated Moron

Warning of unannounced forum closure

Post by Hated Moron »

As discussed previously, the in-browser edition of BBC BASIC for SDL 2.0 is crucially dependent on the availability of its server. If that goes down for any reason, everybody's BBC BASIC web applications stop working. That includes, for example, schools which are using it to deploy coursework to pupils.

So I need to do everything I can to ensure the highest possible availability of the server, and by far the greatest risk is the monthly bandwidth limit being exceeded. If, part way through the month, it looks as though there is a danger that might happen I need to take urgent action to try to reduce the usage so that the remaining bandwidth is enough.

There are relatively few things I can do in those circumstances to reduce throughput, and the easiest is to block access to this forum. Although the activity here is quite low, in respect of posts, there is quite a high usage from bots crawling the forum and downloading it. So temporarily blocking access can be effective.

Ideally I would block access only to non-members, so that registered users could continue to use the forum so long as they are logged in. But that requires the cooperation of the forum's administrator, and communication (and trust) between us has completely broken down. So realistically I would just have to turn off the tap at the server end.

So if you do discover that the forum isn't accessible, that's probably why. All being well, it should return at the beginning of the next calendar month.
DDRM

Re: Warning of unannounced forum closure

Post by DDRM »

Hi Richard,

Sorry to hear that all communication and trust between us has broken down! That's not how I see it.

I still get your PMs, and I'm sure I'd get emails. Happy to restore the need to login if necessary, though I'd have to remind myself how...

I'm VERY busy the next couple of days, so responses might be slow in that period, but should be OK after that.

Best wishes,

D

PS Merry Christmas to everyone! If you are bored, why not re-visit the Advent challenges I posted last year?
Hated Moron

Re: Warning of unannounced forum closure

Post by Hated Moron »

On 21/12/2022 23:56, Maksim AbuAjamieh wrote (cross-posted from the Discussion Group):
Just wondering, is that server highly available in any way or is it a single point of failure?
It's a "single point of failure". Having said that, it has to date been very reliable.
If you do not have a scaling mechanism at the moment, a basic yet easy approach we can do is that you provide the needed build steps, get the public IP from the server donor. Then you can use DNS or any method you like to round-robin the requests between the available servers.
This is not a field in which I have any expertise. All I know is that wasm.bbcbasic.co.uk resolves to 94.229.73.34 which is the server sv4.mhlists-uk1.co.uk belonging to MeirHosting Limited. They are an inexpensive hosting provider, but have proved extremely reliable and responsive to any issues; the only downside is that they don't offer any unlimited (or very large) bandwidth packages - but I probably couldn't afford them if they did!

One possible complication to making the server more resilient is that it's not just a case of serving files. There are PHP scripts that, for example, I use to add COEP, COOP and CORP headers (which all modern browsers require before they will run multi-threaded Web Assembly code, to circumvent the Spectre and Meltdown vulnerabilities).
Hated Moron

Re: Warning of unannounced forum closure

Post by Hated Moron »

On 22/12/2022 11:35, Sean Miller wrote (cross-posted from the Discussion Group):
Hated Moron wrote: Thu 22 Dec 2022, 09:43 One possible complication to making the server more resilient is that it's not just a case of serving files. There are PHP scripts that, for example, I use to add COEP, COOP and CORP headers (which all modern browsers require before they will run multi-threaded Web Assembly code, to circumvent the Spectre and Meltdown vulnerabilities).
Are PHP scripts not just files?
Not really, because they are executed on the server, not on the client (rather in the same way as this phpBB forum is). So they require a hosting account which permits local execution (perhaps with a limit placed on CPU time used) rather than just the ability to deliver files to the client.
Hated Moron

Re: Warning of unannounced forum closure

Post by Hated Moron »

On 22/12/2022 10:27, Maksim AbuAjamieh wrote (cross-posted from the DIscussion Group):
If I was to host a similar server at my office/home, are there any build steps available ?
Yes, the makefile is here (you may need to change some paths to suit your installation). It should create the following files, all of which must be hosted together: bbcsdl.data, bbcsdl.html, bbcsdl.js, bbcsdl.wasm and bbcsdl.worker.js. In practice I gzip the files and serve them with a Content-Encoding: gzip header for efficiency, but that's not essential.

There is a potential gotcha however. The last time I tried to build it using a recent version of Emscripten it didn't run; it appeared that something related to running multi-threaded code in Web Assembly was broken (possibly in Emscripten itself, or perhaps more likely in SDL2; maybe even an incompatibility with my code). So if you want to reproduce exactly what I am doing you will need to use an old version of Emscripten.

emcc --version reports:

Code: Select all

emcc (Emscripten gcc/clang-like replacement) 2.0.5 (b1e5be9cbb01dbf018580dd8e3ba42dd07f1a329)
Hated Moron

Re: Warning of unannounced forum closure

Post by Hated Moron »

On 22/12/2022 17:29, Maksim AbuAjamieh wrote (cross-posted from the Discussion Group):
I tried to build the wasm version on ubuntu 22LTS, and got errors, I downgraded emcc to 2.0.34 which seems to complain less during the build process but still got errors.
I explained that the version I use is 2.0.5, so it's entirely possible that you will need to go back that far (or thereabouts) for it to build and run successfully. In an ideal world I'd find out why it doesn't work in later versions, but life's (literally) too short!
tried to build again but still got errors.. Box2D231.o error and some warnings.
Yeah, you'll need to delete any reference to Box2D. I forgot that was there.
Can you please share clear build instructions for the wasm version (how to build on a freshly installed ubuntu 22 for example)....?
No. I build it in Windows so you're on your own if you are using a different platform. I've made BBC BASIC for SDL 2.0 Open Source but the emphasis is on source, I certainly don't consider I have any responsibility to find out how to build it on platforms different from what I use myself.
I might be wrong but I believe that each version (Win64, WASM, PI, etc) should have a document (something like build.txt) detailing full build instructions.
On most platforms the makefile is all you need, and should get you a working version of BBC BASIC for SDL 2.0 without any further instructions being needed; that has been confirmed by several people who have tried it. However that won't be true for platforms like Android and iOS, because of all the issues related to setting up the build environment (Android Studio and Xcode respectively) which not only can't I document I can't even remember!
Hated Moron

Re: Warning of unannounced forum closure

Post by Hated Moron »

On 22/12/2022 23:02, Maksim AbuAjamieh wrote (cross-posted from the Discussion Group):
Are these php files on a different repository? I cannot find them.
They aren't connected with the build, only the deployment. The GitHub repository doesn't include any files that are relevant only to packaging or deployment, not least because I don't know what the requirements of the person building it will be. For example in this specific case I have no way of knowing what kind of server they will be using (Linux? Windows? Apache? Nginx?).

Vendors of Open Source software typically try to make their version more attractive to users than the vanilla build, by the way it is packaged, deployed and installed. That is true to an extent of BBC BASIC for SDL 2.0, obviously I prefer somebody to download and install the pre-built binary from my site than to build it themselves.

So I definitely won't be adding any packaging or deployment scripts to the GitHub repository!
Hated Moron

Re: Warning of unannounced forum closure

Post by Hated Moron »

On 23/12/2022 10:55, Maksim AbuAjamieh wrote (cross-posted from the Discussion Group):
I have managed to cleanup the wasm code and compile it under a more recent version last night, the rest is easy to do but just needs time.
Does it run (you can test it locally using the emrun command)? When I most recently tried it with a more up-to-date Emscripten it just froze, I suspect at the point of trying to run the second thread. If it does run, I'd like to know what your changes were.
Hated Moron

Re: Warning of unannounced forum closure

Post by Hated Moron »

Hated Moron wrote: Fri 23 Dec 2022, 11:22 If it does run, I'd like to know what your changes were.
Once again, if you managed to build a functioning BBC BASIC using the latest (or a recent) version of Emscripten please tell me what you changed. I would very much like to bring the in-browser edition into line with the desktop editions in respect of the version of SDL2.
mclout99
Posts: 1
Joined: Tue 03 Apr 2018, 12:34

Re: Warning of unannounced forum closure

Post by mclout99 »

I have always wondered if there is a way to run a custom local or hosted server side component ourselves, and if not can we make that happen so we do not have a single point of failure. I have some Window severs and some NAS boxes that I run all kinds of server side projects in my shop. Thanks either way.