Introduction
A few days ago I started reading THE EFFECTIVE ENGINEER and one of the main sentences that shock me was the following:
THE EFFECTIVE ENGINEER
Focus your effort on leverage points.
“Time is your most limited asset. Identify the habits that produce disproportionately high impact for the time you invest.” — Edmond Lau1
Introspection
This led me to ask myself, How I can optimize my time? And I discover that when I work with Airflow, I frequently follow the same set of commands.
- Start container:
astro dev start
- Stop container:
astro dev stop
- Check linter (Flake8, PyDocStyle y MyPY):
./development/tools/build.sh
./development/tools/linter.sh
- Check scheduler logs:
docker exec -it <container_id> /bin/bash
Maybe you can think that it is a few commands however, in my daily work I came across the following scenarios:
- Misspelling commands.
- Forget the order of the statements.
- Forget to give it a start to the container when I gave it a stop.
- Do the linter command without doing the container build
Of course, that situation was not every day. However, I was frequently stressed because I was wasting time. Talking with my teammates I realized that they face the same problems. That is when this situation takes relevant because is the time of an entire team wasted and is not taken advantage of to generate value.
Makefile
To tackle this problem, I create a Makefile with the following command:
|
|
Then I added the bash commands that I used the most. I share with you my current Makefile.
Current Makefile
|
|
Now if I run the following command:
|
|
it returns:
|
|
when I need start Airflow ran:
|
|
restart the service:
|
|
and finally when I need to check the test only ran:
|
|
Conclusion
So far, I’ve been using the previous implementation for about a month. I haven’t made a mistake. Another great thing is that my teammates have adapted and added their commands.