Image for post
Image for post
The workloads in the GKE cluster.

Introduction

I have earlier used Terraform to create Kubernetes in AWS EKS (Amazon Elastic Kubernetes Service) and Azure AKS (Azure Kubernetes Service) and therefore I wanted to create Kubernetes also in the GCP (Google Cloud Platform) to have some perspective on how different the Kubernetes infrastructure is to create in these three major clouds.

My earlier AWS EKS and Azure AKS blog posts are here:

This GCP GKE Kubernetes exercise can be found in my gcp repo in directory simpleserver-kube. I might, later on, continue with this exercise — creating a Helm chart for the Clojure simple server to be deployed to this GKE cluster. …


Image for post
Image for post
Clojure Datomic Exercise in IntelliJ IDEA / Cursive IDE.

Introduction

In my previous Integrant exercise, I had converted my earlier SimpleServer exercise to use the Integrant state management library. In that Integrant exercise, there were three datastores: in-memory datastore that read the initial data from CSV files, AWS DynamoDB datastore, and PostgreSQL datastore. I implemented the domain layer using Clojure Protocols so that in the application it was easy to switch the datastore by changing the value in one Integrant configuration (:backend/active-db ) - and reset the application state by using Integrant reset.

My next exercise was to implement a frontend to that application using re-frame, read more about that exercise in my blog article Clojure Re-Frame Exercise. Since this new Datomic exercise is basically the same exercise as the previous re-frame exercise except the new Datomic datastore added, I created this exercise into the same re-frame application directory. …


Image for post
Image for post
Recording with Clojure.

Introduction

This is the second part of my Clojure Power Tools series (I’m a bit interested myself how many blog posts I will write to this series). If you haven’t read the first part I recommend you to read it first: Clojure Power Tools Part 1. In this second blog article, I list a couple of new power tool tricks for debugging. I’ll first introduce a poor man’s debug repl, and then the real debug repl.

Poor Man’s Debug Repl

I was refactoring some Clojure tests for the second version of a complicated application. There were quite a few structural changes in the application logic, and the domain was rather complicated comprising a lot of various recursive data structures. In some tests, I was quite puzzled about what kind of state there was in several places of the application. The tests were also rather complicated and I wanted a simple way to record certain bindings in several places of the application when I was running a certain area of the test — and only that area. …


Image for post
Image for post
IntelliJ IDEA + Cursive: scratch files.

Introduction

I have been working at Metosin for some months now and I’m learning new Clojure tricks almost every day. I list here some of my favorite Clojure tricks that I have learned either from various Clojure presentations or at Metosin. I know that for a newcomer Clojure might be a bit weird language and newcomers usually don’t know simple productivity tricks. Hopefully, this presentation makes it a bit easier for newcomers to start being productive with Clojure.

Start Doing It

If you are a complete newcomer in the Clojure land I have one recommendation: Just start doing it. Choose an editor, install the required tools, and start learning. The most important thing is that you start learning with a Clojure REPL. And with an editor that has good integration with the Clojure REPL. …


Image for post
Image for post
Clojure Re-Frame Exercise in IntelliJ IDEA / Cursive IDE.

Introduction

I created a simple frontend for my SimpleServer exercise a couple of years ago: SimpleFrontend. In that exercise I used Reagent library which is a minimalistic React wrapper for ClojureScript — I have documented the exercise in Become a Full Stack Developer with Clojure and ClojureScript! blog post. At my company, Metosin, we also use quite a lot another ClojureScript framework that provides some additional utilities like state management — Re-Frame. In this blog post I describe my recent Clojure exercise when I re-implemented the SimpleFrontend using Re-Frame.

The exercise can be found in my Clojure repo in directory re-frame.

What is ClojureScript?

I wrote this frontend exercise using ClojureScript. ClojureScript is a Clojure dialect that transpiles to Javascript. …


Image for post
Image for post
My Dygma Raise Keyboard.

Introduction

I have been using Microsoft Natural Keyboard 4000 for several years and it has served my programming and writing needs pretty well with my Ubuntu laptop .Xkeymap configurations (more about that later). But last spring I followed Koodiklinikka Slack’s “nappaimistot” (“keyboards” in English) channel in order to read experiences regarding mechanical keyboards. There I read some experiences regarding the Dygma Raise Keyboard. I ordered the Dygma Raise keyboard while the company was manufacturing the second batch of the keyboard. I ordered the keyboard in May and I got the keyboard a couple of days ago. …


Image for post
Image for post
Clojure Integrant Exercise in IntelliJ IDEA / Cursive IDE.

Introduction

Last December when I was having a vacation before joining Metosin I decided to train my Clojure skills a bit by implementing my Clojure Simple Server exercise once more. You can read more about that exercise in my previous blog post, Clojure Impressions Round Three. In that blog post, I stated: “You Can Do It Without Application State Management Libraries”. I still agree with that statement, but… When I started working at Metosin last January I talked with the Metosin guys regarding state management in Clojure applications and most of Metosin clojurists were using Integrant. I had some conversations regarding whether to create your own state management (as I did in my previous exercise) or whether to use some state management library. According to those conversations I realized that since these guys are really good clojurists and they are using a state management library there must be compelling reasons that one should use them. So, I decided to implement my Clojure Simple Server exercise once more, this time with Integrant. At the same time I did some refactorings to make the code a bit simpler, and also added a new data store: Postgres (there was a dummy CSV and DynamoDB as data store options before that). …


Image for post
Image for post
Ordinary Clojure code — can be run in REPL or in command line with Babashka.

Introduction

I never bothered to learn Bash so that I could be really fluent with it. If I needed anything beyond basic Bash stuff I immediately used Python in command-line scripting.

I’m currently implementing my Clojure simple server again, this time using the Integrant library. In this new version, I implemented three data stores: CSV, AWS DynamoDB, and Postgres. …


Image for post
Image for post
Cursive REPL output window. Just listing the buckets using my repl scratch file.

Introduction

At my new company Metosin I have been implementing AWS infrastructure using Pulumi and implementing applications using Clojure. We are deploying applications into a Kubernetes cluster and to verify that our applications run with the infrastructure in a dockerized environment as they should we are running tests locally using Drone pipeline (see my previous blog post about it: Using Drone CI ) which spins the required infrastructure using docker containers (Postgres and Minio) and the actual application as another docker container. This week I was wondering that one application behaved a bit differently running tests in my local workstation hitting containers using localhost and running tests inside a docker container. I was discussing this with one Metosin colleague and he told me how to add an nrepl server inside the application so that I can connect to the application running in a docker container and experiment with the running application there using my IntelliJ IDEA / Cursive REPL. Because this trick was pretty neat I thought that I write a short blog post about it. …


Image for post
Image for post
The pretty archaic Drone UI — but that’s all you need with Drone.

Introduction

We have been using Drone CI in our project for some months now. Recently I had to do a major refactoring regarding my team’s Drone pipelines so I thought that now that the Drone configurations are rather fresh in my memory I could write a blog post regarding my experiences with the Drone CI. So, here are my experiences using Drone CI as a developer — if you are looking for sysops stuff like how to install Drone CI, how to do authentication, etc. I’m not writing about that stuff and you need to read e.g. the official Drone documentation.

Drone CI Basics

I’m not going to give a lecture about Drone, you can read more about Drone in Drone CI home page but instead, I write about some important aspects about Drone CI regarding my experiences as a developer who maintains Drone pipelines and uses Drone to build and deploy applications as a daily basis. …

About

Kari Marttila

I’m a Software architect and developer. Currently implementing systems on AWS / GCP / Azure / Docker / Kubernetes using Java, Python, Go and Clojure.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store