Before the Adventure Begins

I have noticed that as people get more experience the way they think about projects changes, and their considerations change. I share a string of thoughts about a project I will begin in the near future in order to shed light on some of the considerations that come up before leaving the Shire.

I want to stop building “small sites” in php for a myriad reasons; enough in fact to write a whole post and a half, which I have since deleted because they’re besides the point, and all specific to me and my circumstances.

The thing is, I want to sub in Kotlin for that purpose. I’m seeking to take the things that make small site development in php so easy for me and make them happen with Kotlin.

Now, why Kotlin is another subject that could span a post and a half. And I have also deleted those. Let’s just say that I’m seeking to write most of my code in Kotlin if I can help it.

The goal is to have Kotlin-based websites that:

  • Can be started trivially. A local setup no more complex than configuring an IDE to deploy targeting a server we have SSH access to.
  • Can have a deployment target trivially spun up (just like you can spin up LAMP images in your cloud provider)
  • Can be deployed trivially.

I have gained some knowledge that will make this quest feasible for me:

  • I have become acquainted with many parts of the Spring Framework. Of particular interest for this scenario are Spring JPA, Spring Boot, Spring MVC, and Thymeleaf.
  • I have spent some time making it easier for me to make deployments when I have ssh access to a target: both through the Gradle SSH Plugin and through Exec tasks that delegate to cmd, ssh, and sftp (these are something of a no-no, since they’re not portable at the time and rely on a Windows installation).
  • I have done due diligence making the Spring Boot executable jar, which runs an embedded Tomcat, work as a systemd service; that’s not too much trouble, really, but it’s important to know it’s possible.
  • I have configured a bundle of nginx instances reverse-proxy requests into my running service. Again, not black magic. It’s good to have it down pat to a tedious, repeatable task.

Oh, yes, and why the nginx reverse-proxy into my service? One massive reason is nginx is many better proven to work correctly than my code. I’d rather not bear the privilege of binding to port 80. And running my web services on port 5000 by default makes it easier to migrate into other manners of hosting.

What will I do to accomplish my goals? Probably write a small piece of Kotlin to aid in provisioning the servers, and rewrite my existing Gradle Exec task so that it works one way in Windows and another in Unix-like environments (Gradle SSH doesn’t play well with Gradle’s Kotlinscript DSL, and I don’t see why I would want to have Gradle code in Groovy when Kotlinscript can make it rain). I may wind up creating another Gradle SSH plugin which doesn’t keel over when inserted into a kts configuration.

The piece of Kotlin to aid provisioning will likely have a cloud-specific API client, and ideally would be able to configure the whole environment with a JVM based ssh client. One alternative I would rather not incur involves creating a Custom Image – it would need to be maintained.

The Gradle task to deploy – and in fact the whole project setup – will likely become a template from which to start all the projects. An archetype, if you will, à la Maven.

I’d be cheating a little because in practice part of the code would be shell script that sets up the system. I can live with that.

Why not make it all a shell script? Because complex decision making in a shell script makes me sad.

After mulling this a bit more, and consulting with colleagues about their experience, the adventure will start.

Mid year stream of thought

It has been a while since I have written anything longer than two tweets. I notice that I have over ten drafts I’ve not looked at in months, which probably means that they’ll never be published.

I’ve distanced myself from the local developer scene in the Dominican Republic. I feel ambivalent about this, but as it’s been about keeping my head down and working, and I’ve been doing just that, I feel content. I look forward to taming my most demanding endeavors in the near future and reacquainting myself with my local peers.

On the other hand, I’ve been interacting more with developers from overseas. It has been fun, being more exposed to developers from a different culture and using different technologies. Usually my work would involve people from either different culture or different technology, not the combo I’m enjoying right now. More data points to learn from.

My dear friend Lois has been posting poems on her site since around August 2017; I think some from 2018 were lost, sadly. I look forward to the 2nd anniversary of getting new poems every Friday.

Now, the hum of the servers quiets down, and I have nothing else to wait for. Back into the fray.

Before stopping I want to record I felt happy with Nintendo’s E3 announcements; that it’s been crazy juggling around a dozen projects (I don’t want to stop and count, really), but it’s been very fulfilling and fun to push the boundaries. Oh, and that it’s very important to have controlled temperature for work. No HVAC means lost efficiency, lost happiness, wasted time, and a general discomfort about existence when you have to work intensely.

A Desperate Effort (follow up)

Sustaining an increased pace of work (related to your usual baseline) over long stretches of time is grueling.

If it is so different from the usual that it’s a desperate effort – well, I’ve not been able to sustain it as well as I’d’ve hoped. I have managed to tweak my work style to better fit my desire for more productivity though:

  • I have lightweight tasks – pleasant to start and carry out – peppered throughout the week which still help me move forward
  • I read stuff written by smart people, which motivates me to work
  • I read stuff written by people with a lot more money than I have, which motivates me to work smart
  • I read stuff written by people with a lot more output than I have, which motivates me to work hard
  • I have a sharper line between work and play

This has allowed me to move in the general direction I want to go. Less waste, more productivity, more happiness.

 

Starting the blog

In order to write more, and be able to share better, I dropped the development of my static site compiler and moved to wordpress.

Over the years I’ve set many rules and goals to achieve before starting to write; among those:

  • Setting up a multi-language website. I’m a native Spanish speaker in a Spanish speaking country, but the broader audience is English speaking.
  • Setting up a static website, and the appropriate generator, to make the maintenance painless — this one was so misguided it’s actually hilarious.
  • Writing a backlog of content, and work with that content in several different ways, including but not limited to: classifying it, running it through trusted people, embellishing it.
  • Getting some OSS projects up and running so I could talk about them — more hilarity ensued by not thinking this one through and noticing a lack of community around my obscure development.
  • Generally trying to improve who I am, so I could project a better picture of myself while remaining truthful. Part of this is related to a severe impostor-syndrome episode, caused in no small part by working on in-house, backoffice software during all of my career.

So what I’ve decided is this: I’ll throw everything overboard and start. I expect a backlog will eventually form, and everything will be nicer as I work and polish my workflow. I’ll write about many things, including what I’m doing now, what I’m reading about, and insights I develop.

This is a start which almost aligns, with a slightly amusing off-by-one error, with the start of 2016. This is a coincidence, as I’d been working on setting up the php and MySQL installation and making sure they played nicely with Lighttpd for a few days, and festivity-related “chores” intervened. I’ll roll with it, though and try and make a nice run.