Next Generation Cloud Network Control Agent
Source code folder:
- Comm: Library for communication with network controllers and transit daemon
- grpc: Auto generated source codes and library for gRPC interface with Alcor Controllers
- net_config: Library for configurating host networking components
- proto3: Auto generated source codes and library for proto3 scheme for communication with Alcor Controllers
- transit_rpc: Library for RPC interface with transit daemon
- test: Unit and integration test code
Since the Alcor Control Agent relies on a few external dependencies, Dockerfile was used for fast build and test environment setup.
The Alcor Control Agent project currently uses cmake for building. It includes the Alcor controller and Transit submodules to consume the needed proto3 schemas and RPC definitions.
To set up your local development environment, we recommend to use fork-and-branch git workflow.
- Fork Alcor Control Agent Github repository by clicking the Fork button on the upper right-hand side of Alcor Control Agent home page.
- Make a local clone:
cd ~/dev $ git clone --recurse-submodules https://github.com/<your_github_username>/alcor-control-agent.git ~/alcor-control-agent $ cd ~/dev/alcor-control-agent $ git submodule update --init --recursive - Add a remote pointing back to the Alcor Official repository
$ git remote add upstream https://github.com/futurewei-cloud/alcor-control-agent.git - Always keep your forked repo (both local and remote) in sync with upstream. Try to run the following commands daily:
$ git checkout master $ git pull upstream master $ git push origin master - Work in a feature branch
$ git checkout -b <new_branch_name> $ ... (make changes in your branch) $ git add . & git commit -m "commit message" - Push changes to your remote fork
$ git push origin <new_branch_name> - Open a Pull Request on Alcor home page, notify community on Alcor Slack channels. You will need approval from at least one maintainer, who will merge your codes to Alcor master.
- Clean up after a merged Pull Request
$ git checkout master $ git pull upstream master $ git push origin master $ git branch -d <branch_name> $ git push --delete origin <branch_name>
Assuming alcor-control-agent was cloned into ~/dev/alcor-control-agent directory:
cd ~/dev/alcor-control-agent
./build/build.shYou can run the test (optional):
root@ca62b6feec63:/mnt/host/code/alcor-control-agent# ./build/tests/aca_testsYou should be ready to run the executable:
root@ca62b6feec63:/mnt/host/code/alcor-control-agent# ./build/bin/AlcorControlAgentIf the docker installation environment is behind proxy the Dockerfile.proxy file needs to be used to build the container.
The proxy imposes the following constrains to the build. The following paragraphs explains the changes made in the Dockerfile
To do this follow these steps.
- $ mkdir -p /etc/systemd/system/docker.service.d
- $ create and edit the http-proxy.conf to add the following content to it:
- $ cat http-proxy.conf
[Service]
Environment="HTTP_PROXY=user:pwd@proxy.com:12345"
Environment="NO_PROXY=localhost,127.0.0.1"
After this reload systemd and restart docker.
- systemctl daemon-reload
- systemctl restart docker
The error message is:
fatal: unable to access 'https://github.com/grpc/grpc/': server certificate
verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
The solution is to modify the Dockerfile and add this line before downloading the grpc package.
- git config --global http.sslverify false
The error message is:
error: RPC failed; curl 56 GnuTLS recv error (-110): The TLS connection was
non-properly terminated.
This errors seems to happen on ubuntu hosts behind a proxy when the package to download is quite big which is the case of grpc. By default git on ubuntu installed by apt install uses gnutls. For smaller packages this error does not appear. Although there are several workarounds like increasing the git http buffers they don't work with software of the size of grpc and the fix is to rebuild git from sources and make it use the openssl version of libcurl.
A new RUN sections have to be added to the Dockerfile to handle this case.