• 1 Post
  • 17 Comments
Joined 1 year ago
cake
Cake day: June 24th, 2023

help-circle



  • Containers can be based on operating systems that are different to your computer.

    Containers utilise the host’s kernel - which is why there needs to be some hoops to run Linux container on Windows (VM/WSL).

    That’s one of the most key differences between VMs and containers. VMs virtualise all the hardware, so you can have a totally different guest and host operating systems; whereas because a container is using the host kernel, it must use the same kind of operating system and accesses the host’s hardware through the kernel.

    The big advantage of that approach, over VMs, is that containers are much more lightweight and performant because they don’t have a virtual kernel/hardware/etc. I find its best to think of them as a process wrapper, kind of like chroot for a specific application - you’re just giving the application you’re running a box to run in - but the host OS is still doing the heavy lifting.



  • I was recently helping someone working on a mini-project to do a bit of parsing of docker compose files, when I discovered that the docker compose spec is published as JSON Schema here.

    I converted that into TypeScript types using JSON Schema to TypeScript. So I can create docker compose config in code and then just export it as yaml - I have a build/deploy script that does this at the end.

    But now the great thing is that I can export/import that config, share it between projects, extend configs, mix-in, and so on. I’ve just started doing it and it’s been really nice so far, when I get a chance and it’s stabilised a bit I’m going to tidy it up and share it. But there’s not much I’ve added beyond the above at the moment (just some bits to mix-in arrays, which was what set me off on this whole thing!)



  • With regards to education, one of the things I’ve come to understand goes entirely counter to the way I was taught at University - for me, programming is a creative activity. It’s an iterative process, and the less constraints I have on how I achieve something, not what I achieve, the better I enjoy it, the more productive I am, and the better by many measures the end solution will be.

    I think that is a key part of what’s missing from CS education, to understand that and lean into it to both increase engagement but also to get people thinking outside the box for solutions to their problems. Students seem to be taught so much, but very little about “Here’s a high-level problem, provide a solution” which is the “core loop” of software development (outside of being a code monkey implementing other people’s designs). You go over requirements and specifications, but you don’t actually DO it… you don’t speak to people, ask the questions, realise they’d don’t know much about software, then later go “Oh shit, I made this assumption and made the wrong thing!”

    One of the things that I used to like more than anything was achieving things even though there were constraints. For example, back in the 90’s even before even AJAX was a thing, I created a site for a betting company that was a SPA and pulled in data and live betting odds. I did this by having a message queue in JavaScript, a hidden frame from which to send messages from the queue to the server using a form, and then the server returned JavaScript code which executed and put the data where needed and updated the page. I absolutely loved that project, and most people on the team just couldn’t believe it was even possible.

    But I didn’t solve it through engineering, I solved it through playing - trying things, seeing what would work/what didn’t, adapting the idea, etc. until I found something that worked - and it was based on some of the things I’d been messing about with in my own time (somewhat bizarrely, creating a sort of online aquarium of Dr. Seuss fish where each one was a person viewing the site!)

    I think if we can inject more of the creativity, tinkering, iterative, playful side into our education it’ll make a huge difference.


  • I left University in the late 90’s and got my first job based on the things I’d been messing about with in my spare time with the University’s facilities/at home (Unix, Internet protocols, client/server arch, distributed computing, etc.) rather than anything I’d been taught. I learnt more in my first 3 months in work than 3 years of education.

    Then the dot-com boom hit, and the number of applicants for any position surged - everyone was going into software development for the money. The whole team became involved in selecting candidates and being part of the interviewing process - it was a nightmare trying to give every person a fair chance. We had some good hires and some bad hires, but the bad hires became such a problem because we had to go through the recruitment mill again.

    But we realised that the number one factor for whether they’d be a good hire or not was not education, but their own personal projects. That’s what mattered. Doing this for fun was the key indicator of being good, and became the ONLY thing we looked for on CVs in the first pass. Doesn’t matter if you have a 1st from Cambridge, if you don’t demonstrate you have a passion for the subject, you don’t get an interview. It was a huge success, and we built an amazing team and saved ourselves a ton of time during recruitment.

    Those people still exist though, I see it all the time! But I think now that the “industry” has grown so much that in any given field there are less people (relatively) being attracted to it. For example, I can see that while back in the 80’s I was drawn to the personal computer, then the 90’s the internet - those things are staples of everyday life now. But I can see more modern young people being attracted to things like AI, drones, quantum computing, 3D printing, and so on as well.


  • Are there any good alternatives?

    We’ve started using Jitsi for video/screen-sharing and that’s going well so far - but it’s based very much around the “corporate meeting” concept, rather than “playing D&D with mates” or “online gaming with people”.

    Mumble is decent enough for voice comms, but of course lacks video, which for my friend group is a deal-breaker. While the audio quality is noticably better most of the time, its noise suppression is not as good as Discord. It does have text chat, but lacks the utility of Discord’s chat - which we use in D&D for sharing information, images, note-taking, etc.

    Things do game tracking/voice like Steam, Xbox Live, PSN, etc. but then each only supports their own platforms and services - whereas Discord is common to all.

    I think what DIscord does well is bring together a few really established, tried and tested technologies, under one roof and integrates them seamlessly. There is definitely value in that, and I would be really interested in an open source/self-hosted equivalent.

    My main concerns with Discord are:

    1. They inevitably ramp up income earning opportunities and therefore eventually compromise the system.
    2. It can’t be catalogued/searched easily.
    3. It seems like a near-perfect platform for harvesting data for ML (and the platform has some traction with the ML community already).




  • vampatori@feddit.uktoSelfhosted@lemmy.worldDefeated by NGINX
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    1 year ago

    Assume nothing! Test every little assumption and you’ll find the problem. Some things to get you started:

    • Does the “app” domain resolve to the app container’s IP from within the nginx container?
    • Can you proxy_pass to the host:port directly rather than using an upstream definition? If not, what about IP:port?
    • Can you connect to the app container from outside (if exposed)? What about from inside the nginx container? What about inside the app container?
    • Is the http(s) connection to the server (demo.example.com) actually going to your nginx instance? Shut it down and see if it changes.
    • If it works locally on 80, can you get it to work on the VPS on 80?
    • Are you using the exact same docker-compose.yaml file for this as locally? If not, what’s different?
    • Are you building the image? If so, are you incrementing the version number of the build so it gets updated?
    • Is there a firewall running on the host OS? If so, is it somehow interfering? Disable it and see.

    While not a direct solution to your problem, I no longer manually configure my reverse proxies at all now and use auto-configuring ones instead. The nginx-proxy image is great, along with it’s ACME companion image for automatic SSL cert generation with certbot - you’ll be up and running in under 30 mins. I used that for a long time and it was great.

    I’ve since moved to using Traefik as it’s more flexible and offers more features, but it’s a bit more involved to configure (simple, but the additional flexibility means everything requires more config).

    That way you just bring up your container and the reverse proxy pulls meta-data from it (e.g. host to map/certbot email) and off it goes.