Tag: productivity

Enterprise Cloud Software: How small is a small team?

Many startups or small companies have very small teams developing big enterprise products, while there are larger companies having multiple people developing and managing the products. A basic enterprise software has the following functions:

  1. Program Management
  2. Developers
  3. Testers
  4. DevOps
  5. Project Managers

Some of these activities can be performed by people having more than one responsibility. For example, a Program Manager might have a dual role of performing Project Management. Or a Lead Developer can take up the role of a project manager besides leading the team.

A developer most often also performs DevOps activity and in case of an SRE can be responsible for the upkeep of the deployed environment.

It really is about scale and the target of the product being developed. For a small to medium B2B application, a dedicated SRE or DevOps Engineer may not be required. A public facing high volume product, though developed with a few developers, will require SRE or a dedicated DevOps Engineer to manage uptime.

So how do we determine the scale of the team? It really comes down to one thing – Are we assuming that persons in the team won’t take leave or will not have emergencies?

As a project, we should have enough redundancies that the deliverables aren’t affected by sudden absence of allotted person to the role.

Let’s assume, a minimal scenario – we have a Lead Developer and a couple of developers on a B2B solution for a small to medium organization. Assuming the delivery date is 2 months away, It is easy to assume that all the three developers will have a day or two during this time in sickness or absent otherwise. In which case does it impact the delivery date or the quality? If the answer is no, then there are enough redundancies and the team size is good. If the answer is yes, it is obvious that the delivery of the product/project is destined for delay or failure. An Enterprise solution cannot be built on the dependence of a few or on the assumption that people won’t take leaves. Either there will be delays or there will be a tragic drop in quality of the product.

A Developers Productivity Setup using a Raspberry Pi (4)

The Objective

I always wanted to have a workspace that could replace many a tool I use as a paid alternative or tools hosted in the cloud. Specially now, when most of the time I spend at home working, I have a need to manage my productivity. It uses docker for easy siloed management and it does not require any complicated system changes that break one app or the other. Additionally Dockerhub is a treasure of images that can be run very easily and can be leveraged.

The only drawback to using docker as an app deployment tool is that all the tools run in different ports and one has to remember the mappings. The mappings are easily visible in portainer and hence useful. Another useful technique is to locally install nginx and use it as reverse proxy.

NGINX Docs | NGINX Reverse Proxy

Tools Installed

  1. Portainer – Visual docker/container management web app. We will use portainer to deploy containers off dockerhub.
  2. BookStack – Notes taking and writing management tool.
  3. Wekan – A trello like Kanban Board/ Lists App.
  4. Bitwarden Server – To store all my passwords locally and not depend on passwords.google.com or Microsoft. Bitwarden is an open-source solution with a server, web app, browser plugin and iOS/Android apps.
  5. Pihole – To Manage my network and conserve my bandwidth. Primarily an Adblocker and I use this to manage intrusive ads on my parents phones and desktop. This I also use to manage access to devices.
  6. Prometheus/Grafana – Monitor the pi and network.
  7. FileBrowser – To manage additional storage. Simple file manager to manage an attached storage. Simply attach a drive to the pi. Attach it to /srv to mount it to the container.
  8. Draw.io – Diagramming Swiss knife.
  9. PlantUML Server – For UML Diagramming
  10. Hoppscotch – REST/Web Socket Client to replace Postman
  11. Owncloud – Optionally I have a stopped instance of owncloud. I dont really need it as I could do with an old HDD attached to the pi.
  12. Code Server – Code Editor/IDE. The Visual Studio Code Server replicates the desktop app to the web. It provides most of the features the desktop editor provides.

Additionally to the above installation, we get the following as dependencies. This can be leveraged for development:

  1. Mongo Server
  2. MySQL/MariaDB – With Booksstack
  3. Additionally install PHPMyAdmin to manage MySQL.

Also other databases can be installed. Databases like Postgres could be run.


Rasberry PI Preparation

I have tested this in a Raspberry Pi 4gb and an 8gb, it could as well run in a 2gb version, but we may have to reduce the number of containers we host. To run docker efficiently, it is better to use a 64 bit image. I have used the raspbian beta image, however one can choose the ever so stable ubuntu server 64 for raspberry pi.

Installation Instruction follow this guide – Installing operating system images – Raspberry Pi Documentation

Disable the gui from raspi-config – raspi-config – Raspberry Pi Documentation

sudo apt-get update && sudo apt-get upgrade

I have found an issue with dhcpcd when a lot of virtual networks are added:

https://github.com/raspberrypi/linux/issues/4092

sudo nano /etc/dhcpcd.conf
at the end: denyinterfaces veth*

Setup Docker & Docker Compose

wget -O - https://get.docker.com -o get-docker.sh | sh

Install docker-compose:

sudo apt-get install -y python3 python3-pip
sudo pip3 -v install docker-compose

Topology

I have attached the raspberry pi 4 to the router using a RJ45 cable. Much faster as I host pihole. The Pi can be added as a WiFi device as well.


Install Portainer

The Portainer installation guide – Docker – Documentation (portainer.io). Run it in the Raspberry Pi commandline.

docker volume create portainer_data
docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce

Browse to the URL of Portainer. Below is how it looks with containers.

Portainer also has App Template feature that can be used to deploy repdefined stake.


Add App from Dockerhub

In most cases the install is straight forward. Click on Containers -> Add A new container.

Choose an image with ARM 64. In the above example, we are adding an nginx server in the above. Once added to portainer, the env and storage parameters can be changed by looking at the documentation.


Add App using Docker Compose

Portainer accepts docker-compse and many stacks can be deployed using a docker-compose file.

below the compose file:

---
version: "2"
services:
  bookstack:
    image: ghcr.io/linuxserver/bookstack
    container_name: bookstack
    environment:
      - PUID=1000
      - PGID=1000
      - APP_URL=
      - DB_HOST=bookstack_db
      - DB_USER=bookstack
      - DB_PASS=bookstack
      - DB_DATABASE=bookstackapp
    volumes:
      - /path/to/data:/config
    ports:
      - 9080:80
    restart: unless-stopped
    depends_on:
      - bookstack_db
  bookstack_db:
    image: ghcr.io/linuxserver/mariadb
    container_name: bookstack_db
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=root
      - TZ=Europe/London
      - MYSQL_DATABASE=bookstackapp
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=bookstack
    volumes:
      - /path/to/data:/config
    ports:
      - 3306:3306
    restart: unless-stopped

Custom Install Apps using Docker Commandline

Requires an advanced understanding of Docker.

A lot of tools may not compile due to the images being built with other platform. The moment there is a “process exec” error, it is probably incompatible with arm 64. In which case the best approach is to rebuild from source using an arm based image.

Portainer automatically will pick up any images added or containers launched.

end.