omni / tokenbridge

Mono repository of Token Bridge (Oracle, Deployment, Monitor). TokenBridge is an interoperability solution between EVM-based networks for assets/data cross chain transfers
http://docs.tokenbridge.net
GNU General Public License v3.0
278 stars 214 forks source link

Publish docker images for releases #100

Open akolotov opened 5 years ago

akolotov commented 5 years ago

It makes sense to think of an approach when an end user will pull a docker image with a bridge component instead of cloning entire git repository. In this case we could have four images on the docker hub:

The CI process could produce arbitrary images, e.g. poa/tokenbridge-oracle:<branch-name> or poa/tokenbridge-oracle:<commit-hash>. As soon as the new release is tagged, the image produced as part of the latest PR will be re-tagged like poa/tokenbridge-oracle:<release-tag>.

This approach should reduce deployment complexity since the number of dependencies is reduced too (e.g. you don't need to install git, python and ansible in order to deploy the oracle on a remote system). It also will make e2e testing for deployment component possible since will reduce nesting number of docker-in-docker beddings.

akolotov commented 5 years ago

@phahulin @ArseniiPetrovich could you please comment the approach? Thanks!

phahulin commented 5 years ago

I think it's a good idea and will simplify things for end-users.

As soon as the new release is tagged, the image produced as part of the latest PR will be re-tagged like poa/tokenbridge-oracle:.

Who will retag it? As a suggestion - I think could reserve master branch for releases and configure CI to automatically publish required images for PRs into master.

rzadp commented 5 years ago

If we take a look at the oracle deployment playbook, there is a lot more happening besides building and launching the oracle container in the jumpbox role, like setting up remote logging for example.

So correct me if I'm wrong, would this approach change only the way jumpbox role works (download oracle image instead of building it), and the end-user would still need to download the repo, install ansible and run the playbook?

akolotov commented 5 years ago

@rzadp thanks for the question.

My expectation is that playbooks will be part of deployment image. The process how playbooks work will be changed as so get needed parameters from the .env file or some yml file and pass them to the deployment container. So, the end user will:

  1. Either perform instructions manually or download very simple shell script.
  2. Prepare a configuration file and run the script
  3. The script pulls the deployment image and runs the corresponding container passing the env to the container or mounting yml file as the volume.
  4. The deployment container connects to the node which is configured in the configuration file, change every thing what is needed to run the oracle on the system - it will includes pulling the oracle/UI/monitor container to the node.

What do you think about this?

rzadp commented 5 years ago

@akolotov Oh I see. So the deployment image would have ansible built in, and the only requirement from the user would be having docker installed. I think it makes sense.

akolotov commented 4 years ago

The deployment process was changed to use pre-built docker images by #280. The discussion to change CircleCI build process as so the docker image will be built appeared there: https://github.com/poanetwork/tokenbridge/pull/280#discussion_r374213267.