Teammates development notes – Initialization

Intro

In this semester there’s a course required in my program which is called Software Engineering Process & Tools. Basically it needs to form a group in the tutorial and then pick one of the four projects they’ve offered. Those four projects are some famous open source projects on GitHub, written in four different programming languages with thousands of users. We need to improve the project and add some functions according to the assignment specifications. I initially preferred choosing PHP (PhpMyAdmin) or Python (OpenPaperless) but my friends in the group prefer the Java one, which is Teammate.

Though I’ve tried writing some tiny helloworld-level Spring Boot applications with Java or Kotlin before, I haven’t looked into Java EE related stuff too much. So this is also the first time I really learn Java EE from scratch.

Here I’m using Java 8 1.8.172/1.8.181 with IntelliJ IDEA 2018.2 as my IDE on macOS 10.13.6, Windows 10 1804 and Ubuntu Budgie 18.04.1

This blog post is currently used for helping my friends in the group who may not be very familiar with Intellij IDEA.

NodeJS installation

In my opinion the best way of installing Node is using the package manager if possible. See here for more details: https://nodejs.org/en/download/package-manager/

You can also use their installation package to install if you wish. But it may be harder to do that on Linux distro (you need to set the environment variables by yourself) and you may also miss out some important updates.

Google Cloud SDK setup

Firstly we need to install Google Cloud SDK. Follow the Google’s instruction here: https://cloud.google.com/sdk

After the installation, remember to run gcloud init to log in with your Google account. Then you may need to install the Java plugin for it by running gcloud components install app-engine-java.

Importing the project

Firstly, just follow the instruction precisely from Teammate official site: https://github.com/TEAMMATES/teammates/blob/master/docs/ide-setup.md

Then when the project is imported and indexed, go to Tools -> Google Cloud Tools -> Add App Engine Support -> Google App Engine Standard:

after that, go to Run -> Run…

then “Edit Configurations”

Add a “Google App Engine Standard Local Server” by this way, shown below:

Press “OK” and it should work now.

Transfer huge amount of source files via network (SCP + GZip)

Scenario

I’ve got a modified AOSP (Mokee, ~50GB with repo cache) need to be transferred from my Mac to my Thinkpad. But macOS does not support linux file systems while Linux does not support apple file systems too.

Solution

After a quick Google, I’ve found a way to solve this issue by using WiFi to transfer.

Simply transfer the file with SCP/FTP is not fast enough as the source tree is way too large. Here we use GZip to compress the data, then put it to SCP’s pipe, and decompress the data on the target machine.

The command is:

tar zcvf - mokee | ssh [email protected] "cd /home/hu/target/mokee/directory; tar zx"

Efficiency

Looks good, 25~35MB/s with 802.11ac (867Mbps, 2×2 MIMO) connection.

15074458869506.jpg

Compile Android kernel without AOSP buildroot environment

Intro

Recently I’ve started a kernel porting project for Xiaomi Mi 6, porting optimisation patches from open source community (e.g. XDA-Developer’s OnePlus 5 forum). Here is a quick note for environment setup and compiling the kernel only without AOSP buildroot.

Preparation

  1. Install dependencies: sudo apt install kernel-package git-core
  2. Download the source: git clone https://github.com/huming2207/Popkern-sagit.git
  3. Toolchain setup: you can either try using Android perbuilt toolchains (may not work on my kernel project due to compiler argument in CFLAG is not supported with GCC 4.9), or build by your own with crosstool-ng

Compilation

  • Set environment variables:
export CROSS_COMPILE=aarch64-your-toolchain-name-
export ARCH=arm64
  • Load configuration file
make defconfig sagit_user_defconfig
  • Build the kernel
make -j8

Creating flashable package

  • Create a DTB-bundled kernel image. Since Xiaomi’s kernel building script somehow messed up, the Image.gz-dtb is the same as Image.gz. So we have to do the merge by our own:
cat arch/arm64/boot/Image.gz arch/arm64/boot/dts/qcom/*.dtb > zImage