Skip to content

2.SVN Check Guide

SVN Inspection Configuration

Server Management

Start by inspecting, modifying or adding the SVN brance you need to inspect in 'Server Managemnt'.

image-20220426145451982

You can edit branch information in 'Server Management', including:

  • 'Host', 'IP' and 'Operating System' do not need editing and will be automatically be shown again after they have run successfully.
  • Branch name: custom, indicates the branch name of the mounted SVN. Cannot be repeated.
  • Mount path: the SVN resource's absolute path.
  • Check path correctness: optional; state the resource root directory to be checked, e.g. home/niyachen/trunk.
  • SVN up path: optional; indicate in which path the SVN update resource update will be run, e.g. home/niyachen/trunk.
  • WebHook: an interface provided to carry out inspections of the resources under this configured path, can be used on with the SVN ci platform, Webhook, to complete incremental pre-hook or post-hook inspections submitted by SVN.

Callback Interface

The project team can set up a callback interface that can be used to receive task results and make custom notifications once the correctness check is completed. After the check, ArtEase will run a POST request to the address mentioned above.

Example of Callback Interface Returned Data:

{
    "status": 1,  // 1 indicates the task was successfully operated, 2 indicates the task ran with errors
    "task": 1,  // 1 indicates incremental tasks, 2 indicates normal tasks
    "task_id": 9527,  // task id
    "task_name": "test", // program name
    "url": "task report link",
    "svn_number": "svn version number", 
    "user": ["submitted by"],
    "branch": "Branch to be checked, mount brankch name",
    "issue":[{"res_name":"resource name","error_data""error data","bug_reason":"error reason"},{},{}]  // indicates the results of the check in the form of a list. Each item on the list has a specific definition: {"res_name": resource name,"error_data": error data,"bug_reason": error reason}。
}

Deploying a Container

Preparation

  • First prepare at least one server for resource inspection, the server must install SVN and Docker.

To install Docker go to: https://yeasy.gitbook.io/docker_practice/install

  • SVN checkout resources. The user running the deployment script must have reading and writing permissions for this directory, and be able to run commands such as 'SVN up' normally. If multiple branches need to be inspected, you must checkout multiple branches to the server.

For the Messiah project, in order to fully make use of all inspection rules, the checkout resource directory must include the Engine directory (to inspect shader), the Repository directory (including all component resources) and the Worlds directory (scene definition); each group can be structured according to the project directory and determine the checkout root directory.

  1. Using the Debian system as an example, first install some file libraries
apt-get update
apt-get install subversion libsasl2-modules-gssapi-mit krb5-user krb5-config
  1. Obtain configuration file
wget -O /etc/krb5.conf http://sac.x.netease.com:8660/download/svn/krb5.conf
  1. Obtain authentication ticket,kinit your company email address (not including the suffix), for example:
root@top-qa02:~# kinit yzxn1709
Password for yzxn1709@CORP.NETEASE.COM: 
root@top-qa02:~# 
  1. Check to see if the ticket information has successfully been configured
root@top-qa02:~# klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: yzxn1709@CORP.NETEASE.COM

Valid starting       Expires              Service principal
03/30/2022 12:02:12  03/31/2022 12:02:06  krbtgt/CORP.NETEASE.COM@CORP.NETEASE.COM
root@top-qa02:~# 
  1. Run SVN operations, checkout the art resources on SVN in the server; this process does not require a password and passwords will not be saved on the server.

Note that the SVN path here has svn:// at the start, rather than https

Fill the path of the art resources into the SVN path here according the the circumstances of the project team - the command below is just an example:

svn co svn://svn-test.gz.netease.com/resource artresource
  1. Because authentication saved using kinit expires after 24 hours by default, in order to avoid needing to set up a new password every time, you must regularly update the kinit authentication file by following the following steps:
yzxn1709@top-qa02:~$ ktutil
ktutil:  addent -password -p yzxn1709 -k 1 -e rc4-hmac
Password for yzxn1709@CORP.NETEASE.COM: 
ktutil:  wkt yzxn1709.keytab
ktutil:  quit
  1. Set up a crontab to regularly perform the task below:
1 * * * * kinit -k -t /home/yzxn1709/yzxn1709.keytab yzxn1709

Now the initialization of the server environment is complete.

Deployment Script

Once all preparations have been made, the deployment script can be downloaded and placed in the server as necessary.

image-20220426161253947

Finally, use the two operations below to complete deployment.

hzhongliang@onlinegame-44-119:~$ chmod +x ArtEase-deploy.sh 

hzhongliang@onlinegame-44-119:~$ ./ArtEase-deploy.sh 

                 _    ______
    /\          | |  |  ____|
   /  \    _ __ | |_ | |__    __ _  ___   ___
  / /\ \  | '__|| __||  __|  / _` |/ __| / _ \
 / ____ \ | |   | |_ | |____| (_| |\__ \|  __/
/_/    \_\|_|    \__||______|\__,_||___/ \___|


Starting to check server environment...

Previous server IP: 10.xx.xx.xx

SVN path in container:trunk=/home/svn/trunk;

Congratulations! Environment check pass complete! Starting to deploy docker container...

Using default tag: latest

latest: Pulling from artease/artease_runner

Digest: sha256:520ed188ff830a5ab21ed4c821af72560597cc5dcb5e147ee74772cc84e16047

Status: Image is up to date for dockerhub.nie.netease.com/artease/artease_runner:latest

Launching docker container...

1ffcc78b033e9bdc1d4f3c74d23c457a22e60fe00e1cc2e7d4aaff6cbb3c03b8

Congratulations! Deployment complete!

-----------------------------