About GCLI

The Technology team of Xianyu has implemented an integrated R&D solution based on Flutter+Servless. With the support of Serverless technology, client development can easily complete business closed loop independently. As the main carrier of Serverless technology business functions, FaaS development efficiency affects the speed of requirement delivery. GCLI is a command line tool based on supporting the FaaS r&d life cycle. It defines the idle fish FaaS development loop, unify the FaaS R&D environment, and is a sharp tool to improve the FaaS r&d efficiency.

The key problem

FaaS development closed loop

The figure below shows a simplified FaaS development lifecycle from the perspective of idle fish development. As with traditional server development, 2.1 to 2.3 are the highest frequency actions. Connecting these actions together to provide standard operational semantics is critical to improving FaaS development productivity. Freefish FaaS wants to provide users with the experience of developing FaaS code as if they were developing native functions.

Unified RESEARCH and development environment

Xianyu FaaS has built a set of tool chains adapted to its own JAVA ecosystem to simplify the FaaS programming plane, but at the same time introduced the consistency of the development environment, the development environment can not convergence management may bring

  • Trapped in the “It Works for me” dilemma, the nature of the problem is delayed by the interference of the development environment

  • The development environment degrades, for example, environment variables are overwritten or the OS is passively upgraded, resulting in compatibility problems

  • Adapt to the development environment. Libraries and tools developed based on Linux cannot run in non-Linux environment

  • Start From Scratch, for a new technology stack, development environment installation and configuration is one of the factors that prevents users From trying to innovate

The above points have been fulfilled in The practice of Xianyu. Later, Xianyu tried to solve the problems of the environment based on WebIDE development. However, there is a gap between the experience and the ideal at the present stage. How to unify the development environment and continue the development habits of users is also a key consideration.

GCLI solution

In order to solve the above two core problems, as shown in the figure below, GCli disassembled the r&d closed loop into development instructions suitable for Serverless R&D custom; In order to let users inherit its r & D habits and tools, Xianyu prioritized local based development programs; Use Docker technology to unify the development environment and declare the operating environment (software + configuration) that the Dart FaaS stack depends on in Dcoker.

With the help of container technology, the FaaS software environment can be ported to any operating system that supports Linux, thus solving the problem of environment unification. GCLI interoperates with the local and functional platforms through the FaaS Open API, forming a complete r&d loop.

GCli command line

The GCli command line is designed as a standalone executable to remove the runtime dependency of the corresponding programming language. It will convert user development instructions into Docker operation commands, and control Docker’s life cycle with certain policies. Here is a snippet of GCLI functionality:

Users can develop functions with the help of gCLI-defined development instructions. For example, if the user starts hot deployment and only cares about code writing, GCLI synchronizes the code to the cloud in real time, then calls the function once and observes the return and result of the function.

– Develop functions using GCLI hot deployment and logging instructions


     

    # Enable hot deployment capability to monitor code changes in real time and implement them in the cloud in real time

    gcli hotdeploy -f my_function --watch

    Call the remote function to get the result of the call

    gcli invoke -f my_function --data '{"data":{}}'

    # Check whether the cloud function logs run tail

    gcli logs -f my_function --tail

Copy the code
                                        
     

    # pull function container locally

    gcli local start

    # local debug

    gcli local debug

Copy the code

GCLI Docker container

  • Host IDE side

  • The user code directory is mounted to the container by bind, and then compiled inside the container, after which the product is recognized by the IDE

  • GCLI performs port mapping, bind mount, or environment variable import operations through Docker synchronized configuration files

  • Volume allows hosts to share files in containers (such as pub and Maven repositories) to improve compilation speed

  • The host connects to the container through NAT address translation, and port translation information is defined in the CONFIGURATION file of GCLI

  • Side of the container

  • Image acceleration area, in order to improve the speed of compilation, in the image preset may need cache files and environment variables

  • Software repository, which defines the software that needs to be synchronized to host

  • Compile/run time environments, including language runtimes, environment variables, repositories, and so on

  • Custom software, GCLI provides the implementation of the development instructions from here

Earnings and Outlook

  • With lower barriers to development and cross-stack friendly, non-DART stack developers can go from bare-air to complete development and deploy FaaS services in 30 minutes.

  • The local development environment is stable and reliable, which completely eliminates the problems caused by inconsistent development environment and saves precious development time.

  • The closed-loop instructions are easy to use, and before GCli came out, 50% of all development would have abandoned custom development tools because of their complexity and error-prone nature in favor of traditional, inefficient development. For example, the traditional deployment takes 10 minutes, but the GCLI takes 5 seconds.

  • Tolerating the development of Windows and other operating systems plays a positive role in promoting a new development model.

Xianyu Technology team is not only the creator of alibaba Group’s idle trading community, but also the leader and innovator of new technologies for mobile and high-concurrency big data applications. We work closely with the Google Flutter/Dart team, contributing multiple high-star projects and a lot of PR to the community. We are actively exploring the innovative application of deep learning and visual technology in interactive, transactional and community scenarios. The FaaS platform built by Xianyu technology and the group middleware team supports high concurrent access scenarios of tens of millions of users every day.

Now! Client/server Java/architecture/front-end/quality engineer For the society + campus recruitment, base Hangzhou Alibaba Xixi Park, together to create creative space community products, do the depth of the top open source projects, together to expand the technical boundaries of the ultimate achievement!

* Send resumes to small idle fish →[email protected]



Please look for the idle fish technology