Commit Graph

17 Commits

Author SHA1 Message Date
Sebastian Kunert 9485b0b492 Point documentation links to monorepo (#1741) 2023-09-29 22:33:26 +02:00
Egor_P eeb368ed9c GHW for building and publishing docker images (#1391)
* add ghw and scripts for docker image deployment

* debug

* add permissions for content

* fix path to the bin folder

* add tags

* rename env

* fix path to docker file

* make polkadot-parachain executable

* fix typo

* fix more typos

* test

* revert back  use of  working directory

* mke bin executable in the artifacts folder

* use cd instead of working directory

* change path to cash

* fix path to cash

* change cache key

* delete old flows

* addressed PR comments

* fix path

* reorg docker files
2023-09-06 17:11:10 +03:00
Egor_P 953a07a2c6 Refactor docker image build (#3045)
* add lib.sh file from polkadot to reuse existing functionality

* use personal repo for test

* add debug line for visibility

* add more debug

* make lib.sh executable

* more debugging

* add permissons to read conents

* test write permissions for the contents

* try download wothout token

* cleanup

* add lib.sh from polkadot to the manual step

* add new manual docker image build + renaming of the release image build

* replace existing manual docker image publishing to test

* add checkout of lib.sh from polkadot

* copy lib.sh from temp to the artifacts folder

* change path to the artifacts folder and cleanup

* rename to test

* make binary executable

* fix path to binary in the for loop

* add debug

* make bin executable right after fetching it

* change is_final field to a string value

* Add semver version extraction for a tag

* add tags to the image

* tag iamge after it was built

* refactor tagging

* fix docker owner issue in build step

* push right after tagging in loop

* rename of the file

* cleanup

* update workflow description

Co-authored-by: Chevdor <chevdor@users.noreply.github.com>

* use choice to determine type of the image

* add combimed flow for image piublishing

* change conditions

* change conditions for event action

* test another conditions

* fix conditions

* fix typo in conditions

* split fetching artifacts into release and rc

* fix if

* split the rest based on rc or release image

* refactor push and check

* fix if in rc artifacts fetch

* copy lib.sh to the artifacts dir

* cleanup

* address PR comments

---------

Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
2023-08-24 08:49:48 +00:00
Egor_P 640f5ad5c1 exclude polkadot-parachain.asc and .sha256 from .dockerignore (#3013) (#3017)
* exclude polkadot-parachain .asc and .sha256 from .dockerignore

* refactor docker image creation GHA



* add debug

* try without quotes

* test action

* add quotes

* fix quotes atumated image publishing GHA

* delete old unused part

---------

Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
2023-08-16 08:26:42 +00:00
Alexander Samusev 059d992e03 [ci] Add build docker test-parachain for zombienet (#1327)
* [ci] Add build docker test-parachain for zombienet

* debug ci

* disable cancel pipeline

* fix wrong rename

* enable jobs

* uncomment needs

* fixes
2022-06-02 19:20:22 +02:00
Alexander Samusev 2e514ad005 Publish polkadot-parachain docker images on PRs (#1311)
* [WIP] Dockerize polkadot-parachain

* fix build job

* disable test job for debug

* disable all tests for debug

* add publish docker

* fix docker publish

* uncomment tests; add dag

* fix docker naming

* add DAG to build job

* small fixes

* combine test and build

* fix typo

* divide test and build back

* Update .gitlab-ci.yml

Co-authored-by: Denis Pisarev <denis.pisarev@parity.io>

* rename docker image

* add needs publish-s3

* remove collect artifacts from test

Co-authored-by: Denis Pisarev <denis.pisarev@parity.io>
2022-06-01 15:07:19 +02:00
Squirrel bc0c98884f dir restructure to support more CGP (#1266)
* rerame res to chain-specs

* split polkadot-parachains dir

* rename dir parachains-common to common

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: Wilfried Kopp <wilfried@parity.io>
Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
2022-05-20 13:43:04 +01:00
Squirrel 1474308bbb rename polkadot-collator to polkadot-parachain (#1241)
* rename polkadot-collator to polkadot-parachain

Not every node has to be a collator.

* Update README.md

Co-authored-by: Chevdor <chevdor@users.noreply.github.com>

* rename docker file

* Update .github/workflows/extrinsic-ordering-check-from-bin.yml

Co-authored-by: Chevdor <chevdor@users.noreply.github.com>

* Versioning scheme that tracks polkadot relay chain

but allows for patch releases by having a 0 at the end.
(`-patch1` patch naming schemes were discussed but they
were judged to cause downstream packagers pain.)

* update name

* update lock file

Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
2022-05-13 13:02:52 +00:00
Sergejs Kostjucenko 1d42ecadb0 Move scripts used in CI to the new location (#1109)
* Move CI scripts to new location

* Update references

* Update CODEOWNERS file

* Update docker/polkadot-collator_builder.Containerfile

Co-authored-by: Alexander Samusev <41779041+alvicsam@users.noreply.github.com>

Co-authored-by: Alexander Samusev <41779041+alvicsam@users.noreply.github.com>
2022-03-25 01:25:06 +02:00
Chevdor f42092d23e Add CI to build docker images on releases (#836)
* Fix the url of the fetched file

* Fix binary in the GPG check

* Add docker build

* Import GPG pub keys

* Copy missing binaries

* Checkout first

* Add missing mkdir

* Set bin as executable

* Fix exec flag earlier

* Fix docker calls

* Fix version parsing

* Fix image names

* Cleanup

* Fix ENV issue

* Only allow user keys on pre-releases

* Add Docker Hub token and enable pushing

* Make Docker owner configurable via secrets

* Fix owner

* Remove duplicate secret
2021-12-07 14:50:16 +01:00
Denis Pisarev ab2c9cd020 polkadot collator builder (#740)
* dockerfiles: polkadot-collator_builder.Containerfile and docs

* dockerfiles: optimize test dockerfile
2021-11-11 13:57:57 +01:00
Denis Pisarev ce90615762 dockerfiles: upgrade to ubuntu:20.04 (#603) 2021-09-12 00:41:17 +02:00
Chevdor d260b0e14f Add script and dockerfile to build an injected docker image for the polkadot-collator binary (#591)
* remove exec flag on json file
* fix dockerignore filter to allow building the injected docker image
* Update docker/injected.Dockerfile
* Update docker/scripts/build-injected-image.sh

Co-authored-by: Martin Pugh <pugh@s3kr.it>
Co-authored-by: Denis Pisarev <denis.pisarev@parity.io>
2021-09-03 15:30:12 +02:00
Shawn Tabrizi e286e0451c rococo-collator -> polkadot-collator (#449) 2021-05-24 11:14:12 +02:00
Dan Forbes e739334f76 Rename cumulus-test-parachain-collator to rococo-collator (#173)
Ran `find . -type f -name "*" -print0 | xargs -0 sed -i -e "s/cumulus-test-parachain-collator/rococo-collator/g"`
2020-08-04 19:44:02 +02:00
Cecile Tonglet 537a311587 Move Docker scripts (#138)
Just reorganizing
2020-07-16 07:46:03 +02:00
Peter Goodspeed-Niklaus 5678c8a188 Automatic Example Collator (#67)
* add polkadot build script

* Add scripting to bring up a simple alice-bob example net

Demonstrated to produce blocks, but as of right now there's still
trouble getting it to respond to external queries on its ports.

* enable external rpc access to the nodes

Also shrink the build context by excluding some extraneous data.

* Ensure external RPC access works

Also set default branch appropriately, and have the stop command
clean itself up more thoroughly.

* Add multi-stage dockerfile for building the cumulus-test-parachain-collator

- Exclude the docker/ directory from build context because we're
  never going to build recursively, and this prevents spurious
  cache misses
- build the parachain collator in three stages. The build stage
  is discarded; the collator stage has a wrapper script to simplify
  generating the right bootnodes flags, and the default stage
  has just the binary in a small runtime.
- build_collator.sh collects appropriate build flags for the dockerfile
- inject_bootnodes.sh discovers the testnet node IDs and inserts them
  into the arguments list for cumulus-test-parachain-collator

* Add services which generate genesis state, run the collator

- Ignore the scripts directory to reduce spurious cache misses.
- Move inject_bootnodes.sh from the scripts directory into the root:
  It can't stay in the scripts directory, because that's ignored;
  I didn't want to invent _another_ top-level subdirectory for it.
  That decision could certainly be appealed, though.
- Move docker-compose.yml, add dc.sh, modify *_collator.sh: by
  taking docker-compose.yml out of the root directory, we can
  further reduce cache misses. However, docker-compose normally
  has a strong expectation that docker-compose.yml exist in the
  project root; it takes a moderately complicated invocation to
  override that expectation. That override is encoded in dc.sh;
  the updates to the other scripts are just to use the override.

The expectation as of now is that scripts/run_collator.sh runs
both chain nodes and the collator, generates the genesis state
into a volume with a transient container, and runs the collator
as specified in the repo README.

Upcoming work: Steps 5 and 6 from the readme.

* Launch the collator node

The biggest change here is adding the testing_net network to the
collator node's networks list. This lets it successfully connect
to the alice and bob nodes, which in turn lets it get their node IDs,
which was the blocker for a long time.

Remove httpie in favor of curl: makes for a smaller docker image,
and has fewer weird failure modes within docker.

Unfortunately this doesn't yet actually connect to the relay chain
nodes; that's the next area to figure out.

* enable external websocket access to indexer nodes

* Reorganize for improved caching, again

- Manually enumerate the set of source directories to copy when building.
  This bloats the cache a bit, but means that rebuilds on script changes
  don't bust that cache, which saves a _lot_ of time.
- Un-.dockerignore the scripts directory; it's small and will no longer
  trigger cache misses.
- Move inject_bootnodes.sh back into scripts directory for better organization.
- inject_bootnodes.sh: use rpc port for rpc call and p2p port for
  generating the bootnode string. I'm not 100% sure this is correct,
  but upwards of 80% at least.
- docker-compose.yml: reorganize the launch commands such that alice
  and bob still present the same external port mapping to the world,
  but within the docker-compose network, they both use the same
  (standard) p2p, rpc, and websocket ports. This makes life easier
  for inject_bootnodes.sh

The collator node still doesn't actually connect, but I think this
commit still represents real progress in that direction.

* Get the collator talking to the indexer nodes

In the end, it was four characters: -- and two = signs in the
launch arguments. They turn out to be critical characters for
correct operation, though!

Next up: automating step 5.

* Add runtime stage to collect runtime wasm blob into volume

We can't just copy the blob in the builder stage because the volumes
aren't available at that point.

Rewrite build_collator.sh into build_docker.sh and update for generality.

* WIP: add registrar service and partial work to actually register the collator

This is likely to be discarded; the Python library in use is 3rd party
and not well documented, while the official polkadot-js repo has a
CLI tool: https://github.com/polkadot-js/tools/tree/master/packages/api-cli

* Add a parachain registrar which should properly register the parachain

Doesn't work at the moment because it depends on two api-cli features
which I added today, which have not yet made it out into a published
release.

Next up: figure out how to add the `api-cli` at its `master` branch,
then run tests to ensure the collator is producing blocks. Then,
automate the block production tests.

* BROKEN attempt to demo registrar communication with the blockchain

This is a really weird bug. After running `scripts/run_collector.sh`,
which brings everything up, it's perfectly possible to get into
a state very much like what the registrar is in, and communicate
with the blockchain without issue:

```sh
$ docker run --rm --net cumulus_testing_net para-reg:latest polkadot-js-api --ws ws://172.28.1.1:9944 query.sudo.key
Thu 20 Feb 2020 12:19:20 PM CET
{
  "key": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"
}
```

However, the registrar itself, doing the same thing from within
`register_para.sh`, is failing to find the right place in the network:

```
/runtime/cumulus_test_parachain_runtime.compact.wasm found after 0 seconds
/genesis/genesis-state found after 0 seconds
2020-02-20 10:43:22          API-WS: disconnected from ws://172.28.1.1:9944 code: '1006' reason: 'connection failed'
_Event {
  type: 'error',
  isTrusted: false,
  _yaeti: true,
  target: W3CWebSocket {
    _listeners: {},
    addEventListener: [Function: _addEventListener],
    removeEventListener: [Function: _removeEventListener],
    dispatchEvent: [Function: _dispatchEvent],
    _url: 'ws://172.28.1.1:9944',
    _readyState: 3,
    _protocol: undefined,
    _extensions: '',
    _bufferedAmount: 0,
    _binaryType: 'arraybuffer',
    _connection: undefined,
    _client: WebSocketClient {
      _events: [Object: null prototype] {},
      _eventsCount: 0,
      _maxListeners: undefined,
      config: [Object],
      _req: null,
      protocols: [],
      origin: undefined,
      url: [Url],
      secure: false,
      base64nonce: 'aJ6J3pYDz8l5owVWHGbzHg==',
      [Symbol(kCapture)]: false
    },
    onclose: [Function (anonymous)],
    onerror: [Function (anonymous)],
    onmessage: [Function (anonymous)],
    onopen: [Function (anonymous)]
  },
  cancelable: true,
  stopImmediatePropagation: [Function (anonymous)]
}
```

They should be connected to the same network, running the same
image, doing the same call. The only difference is the file
existence checks, which really shouldn't be affecting the network
state at all.

Pushing this commit to ask for outside opinions on it, because
this is very weird and I clearly don't understand some part of
what's happening.

* Fix broken parachain registrar

The problem was that the registrar container was coming up too fast,
so the Alice node wasn't yet ready to receive connections. Using
a well-known wait script fixes the issue.

Next up: verify that the collator is in fact building blocks.

* fixes which cause the collator to correctly produce new parachain blocks

It didn't take much! The biggest issue was that the genesis state
was previously being double-encoded.

* add documentation for running the parachain automatically

* Add health check to collator

* minor scripting improvements

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Docker: copy the whole workspace in one go

Pro: future-proofing against the time we add or remove a directory
Con: changing any file in the workspace busts Rust's build cache,
     which takes a long time.

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-02-21 16:20:22 +01:00