How to build a secure policy source management system



   recently, I communicated with some friends who do strategy research and development, and found thatNot quantitative researchers with technical background, most of them will not do source version management. The most common scenario is that every time there’s a big change, it doesn’t workRename the original code for backup, and then create a new source code file with different tags for modification and testing. There’s even a friend who’s been hitThe transaction server hangs up, resulting in the loss of the latest version of the policy source codeIt’s an extreme situation.
                  version management It’s good for you. Just recently, I’m going to help my friends sort out some things related to version management, and I’ll share them with you, hoping to help you.

Introduction to version management

Basic concepts of version management

   I believe readers with technical background are very familiar with version management. Here is a brief introduction. Version management isThe process of recording, tracking, maintaining and controlling the series changes of the same product or system caused by local modification

Benefits of version management

  • Source centralized management, you can synchronize the latest source code from different devices
  • Every time the source code is modified, it will be recorded and can be traced back and tracked at any time
  • In addition to the comments in the code, the comments when submitting the source code can help developers understand the main content of a modification as a whole
  • Some version management tools also provide rich branch management tools, which is very convenient

The necessity of version management

  • For a slightly more complex project, it is not possible to perform a separate backup management for each source file
  • Source code stored in the local, it is difficult to support multi device collaborative work
  • The source code exists in the local and version libraries at the same time, which is equivalent to having multi-point backup. Unless the device where the version library is located and the local device are irreversibly damaged at the same time, it is impossible to lose the source code
  • Multi person collaboration also relies on version management

Version log screenshot
How to build a secure policy source management system

Code comparison screenshot
How to build a secure policy source management system

Code tracing screenshot
How to build a secure policy source management system

Using version management

   in front of the general introduction of some of the characteristics of version management, to establish a version library, select an appropriate version libraryVersion management toolsIt’s also very important.
Version management tools have experienced different popular tools in different periods, and the most popular version management tool at present isGitandSVNGitrelativeSVNIt’s more flexible, supports local submission, and manages branches better, so it’s sought after by the whole industry.
Next, this article will introduce three methods of building version library, which are all based onGitYes.

Using code hosting platform to manage source code

   there are many kinds of Internet nowadaysCode hosting platformOn the one hand, these platforms provide basic version management functions, and on the other hand, they are also the places where open source libraries are collected.

  • github
      githubIt is one of the most popular code hosting platforms abroad. It mainly provides code hosting services for open source and private software, and only supports git as a version management tool. It has been acquired by Microsoft.

    • advantage

      • A large number of open source software, including many well-known open source projects
      • There are a large number of users at home and abroad
      • In addition to open source projects, it also supports private libraries (up to 3 collaborators)
      • Foreign intellectual property protection is better, the security of the source code is relatively guaranteed
    • inferiority

      • Because of the particularity of domestic network,githubServer in the United States, domestic access speed is seriously limited
      • Private libraries only supportUp to 3 people working together
    • cost

      • The direct cost of personal use is 0
      • In order to have smooth access, you may need to purchaseVPN
  • gitee
      giteeIt is a code hosting platform launched by open source China. Basic functions andgithubBasically consistent, support version management tools are also availableSVN

    • advantage

      • Domestic server, domestic access speed is fast
      • Support direct fromgithubSynchronization of open source projects is equivalent togithubSet upVPN
    • inferiority

      • International recognition is not enough, can only be used in the domestic open source circle
      • Private libraries only supportUp to 5 people working together

Using software to build code hosting platform

   the source code of quantitative strategy pays more attention to the security of source code than software source code. There are many peers in the management of policy source code, will worry about their own policy source disclosure. In view of such concerns, I recommend that these friends can consider building a code hosting platform.
   compared with the online code hosting platform, the advantages of self built hosting platform are obvious

  • Absolutely private
  • Completely controllable
  • Unlimited number of collaborators
  • More flexible service configuration

However, there are still some disadvantages in this way:

  • You need to provide your own server. If you rent a cloud machine, it costs at least a thousand years
  • The introduction of technology stack is too much, and most quantitative researchers can not use it well

   but for some friends who have already invested in equipment, this is also a very good choice. If a friend needs to use this way to build their own version management, the author is currently using in the company isGitblitCode management, you can understand.

Using cloud disk to build local hosting platform

   the two methods mentioned above are both conventional methods, otherwise the security is questionable, or the cost is too high, and additional technology stacks need to be introduced. The third scheme I would like to introduce today is the following:Using cloud disk to build local hosting platform

  • Basic principles
    There are two ways to do thisnecessary condition

    • SVNandGitAll support itVersion Library Based on local file systemIn short, the version library can be built in a local folder
    • Real time synchronization function of cloud diskThe author uses360 cloud diskThe similar products areNut cloudetc.

    Based on the above two necessary conditions, you can create a new special folder under the local folder mapped to the cloud disk, and create a local version library on this file(SVNGitWhen using, you only need to map the version library to the local path of the cloud disk.

  • Build process
    There is no reason to talk, the following author to his library as an example, to show you the process of building.

    • Purchase the cloud disk supporting synchronization first (please pay attention to whether the capacity is enough)

    How to build a secure policy source management system

    • Install the cloud disk synchronization software and map it to the local directory

    How to build a secure policy source management system
    How to build a secure policy source management system

    • New oneSourceGitCatalog, and useGitstaySourceGitCreate a pure version Library

    How to build a secure policy source management system

    • Create a new working directory andcloneThe version library just created

    How to build a secure policy source management system
    How to build a secure policy source management system

    • Create a new one in the working, and write something casually

    How to build a secure policy source management system

    • Submitreadme.mdTo the local version Library(WorkDir)

    How to build a secure policy source management system

    • Push the code to the remote version Library (in the cloud disk)SourceGit(table of contents)

    How to build a secure policy source management system

The above is the authorKey recommendationIn addition to providing a complete way of source code management, the most important point of this scheme may also be the concern of many quantitative practitioners,The privacy and security of the source code are absolutely guaranteed. The reasons are as follows:

  • Cloud disks are all for personal use, so it’s hard to leak out
  • After the source code is pushed to the remote version Library (cloud disk), it is stored in binary form
  • Unless someone clearly knows the way users use the cloud disk and what the files in a directory in the cloud disk are, it is useless to get these binary files

Concluding remarks

I believe that through the introduction of this article, readers should have a general understanding of how to manage their own strategy source code. Because of the limited time, this paper does not expand the specific usage of various tools. If readers are interested in the scheme recommended by the author and want to try it, they can send a private letter to the author if they have any questions.

  WonderTraderIt aims to provide a better wheel for the quantitative practitioners, encapsulate the technology related things in the platform, and strive to bring better strategy development experience to strategy R & D.

   withWonderTraderGradually more and more people understand, there are a lot of friends on theWonderTraderArchitecture design and source code show a very strong interest, want to have an in-depth understandingWonderTraderThe internal code details of. It also gives the author some ideas to know the details of the architecture. After thinking about it for a while, I decided to publish a series of articles in the next few weeks, mainly about introductionWonderTraderSome of the design details. The content of the article may be a bit technical, I hope that interested friends will be more supportive.

Finally, AmwayWonderTrader


WonderTraderOfficial website address:


There are risks in the market and investment should be cautious. The above statement is only a review of historical events, does not represent a view on the future, and does not serve as any investment proposal.

Recommended Today

CentOS makes document server based on nginx

CentOS makes document server based on nginx Basic environment for installation yum install gcc-c++ yum install -y pcre pcre-devel yum install -y zlib zlib-devel yum install -y openssl openssl-devel Find the latest stable version of nginx on the official website Stable version: cd /home wget -c Decompress compressed package data tar -zxvf […]