Archive for the ‘Tools’ Category

Development Environment Setup, A Story

One of the parts that I don’t really like when starting/joining a new project, is setting up my development environment (dev env). Sometimes, it takes a long time. Once, at my first job, the first three days were spent to set up my dev env. It was creating a plugin for a desktop application. Well, I think again, it was more on my first real experience using non-Windows OS. It was Ubuntu. 😀

I also had an experience with setting up a development environment for a web project that uses Virtual Machine. It was very exhausting. VM is very heavy for my computer. I don’t really recommend it. I use it since I needed to use specific dependency version that not compatible with my OS (mine was Ubuntu 14, it needs Ubuntu 16). Ouch.

Virtual Machine is not my favorite for sure. It’s very heavy, you need to install many things.

Then there is this cool guy, docker. A smaller version of Virtual Machine. It’s very light. You can spin up more than one easily. With a docker compose, you can orchestrate your whole system easily. It’s really helpful. You can have the same environment like in production. No longer “but, it works on my machine“.

I am still using it.

Another thing to set up is your IDE. For example in my favorite IDE, PyCharm, you can set your custom python env, running env, and so on. Sometimes, you miss one step, and it’s not working like in your friend’s laptop.

My friend had this idea, to use Ansible to setup PyCharm. It’s a little bit hacky, but it works. It hacks the PyCharm configuration (which is an XML file). By using Ansible also, he customizes the docker compose override file to match with our computer env. It works really great. Only by updating some variables in all.yml, run it, you can have the same setup as your friend.

Another thing is Rancher. Docker is great, but you need to remember all the commands. I don’t really like it. My company uses it to deploy on the server, for production and staging. I think it’s a great product also. No need typing command, no need to log in to the server. It has nice UI to manage your system. It’s recommended to use also.

So, my current choices are Docker, Ansible, and Rancher. It can be changed for sure. I recommend these tools for your work.

Btw, for a small project, I also use virtual env for python development. It’s easier to setup when I just need to have clean python environment. I also recommend it. But for a bigger project that have many parts, I don’t really recommend it, although I have ever done it :).

Thanks for reading, and please share if you have tips for setting up dev env.

P.S.: Looking back, it’s very funny to remember that I need to spend 3 days for dev env setup. Well, I couldn’t even exit from Vim.


Archive Submodule in git

One of project that I worked on needs to make a package to be released. The packaging it’s very simple since it’s python. Basically, removing all un-needed code for production (e.g. unit test code, test data, script). Then, we archive it by using git archive command.

It works well until we use git submodule. We found out that the git archive  command doesn’t do the archiving recursively. Thus we need a better tool to do it.

After a quick googling, I find this nice tool to solve the problem. It’s git-archive-all. Basically, what it does is archiving repository:

It’s python based. You can install it using pip. Or if you use macOS, you can install it by using brew.

Another nice tool to help human being 🙂

%d blogger menyukai ini: