Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Docker files chore #3880

Merged
merged 26 commits into from
Sep 28, 2021
Merged

Docker files chore #3880

merged 26 commits into from
Sep 28, 2021

Conversation

alvicsam
Copy link
Contributor

Renamed docker files with unified naming convention, adjusted .gitlab-ci.yml and documentation.
Moved docker folder to script/docker/polkadot, adjusted scripts and documentation.

Closes https://github.com/paritytech/ci_cd/issues/197

@alvicsam alvicsam requested review from chevdor, bkchr, TriplEight and a team September 17, 2021 14:14
@alvicsam alvicsam added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. labels Sep 17, 2021
Copy link
Contributor

@TriplEight TriplEight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Please add the metadata to https://github.com/paritytech/polkadot/blob/1c0c709a92de263dcf7edadc7c96f2eb847b3c38/scripts/docker/polkadot/manual.Dockerfile and mention a scripts/docker/polkadot/README.md there.
    Metadata should be quite similar to the same in ci. and release. Dockerfiles, just mention the type of the image in the description and have different links.
  • please decide something stable with the naming convention (this is a first time we apply it, and it's not yet really written). So, where to put ci/manual/release/debug before the name or not (collator_ci vs ci_collator), what to use in which case - underscore or hyphen (ci_debug vs staking**_**miner**-**ci). And it would be a good help to write this naming so it would go to the fresh policy document.

Copy link
Contributor

@chevdor chevdor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the naming of image is appropriate.
For instance an image called ci-debug could belong to any project and do anything...
I commented about the naming in the issue that initiated this PR.

@TriplEight
Copy link
Contributor

also commented to the initial issue

Copy link
Contributor

@chevdor chevdor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor issue with one image name

@chevdor
Copy link
Contributor

chevdor commented Sep 22, 2021

Sorry for the nits but I think this PR is the place set those.

Multiple files vs ARG

Do we really want to have polkadot_injected_release.Dockerfile and polkadot_injected_debug.Dockerfile or could we manage with a single file and an ARG to describe this debug/release ? If we really have 2 files for polkadot, we probably also will need 2 for the collatator, staking-miner, etc... and that will explode the number of files.

Naming

I think we still have a mix in the names. For the staking-miner for instance, it should be everywhere (file names, doc, etc...) staking-miner_foobar and not staking_miner_foobar.

@TriplEight
Copy link
Contributor

@chevdor this all sounds good, thank you for your help.
I'd like to add that i.e. the collator_injected.Dockerfile and polkadot_injected_debug.Dockerfile are identical and the difference is only the binary name, we could definitely put it into ARG.
The question here is where to draw the line. We could

  • put a binary name into ARG and remove every second Dockerfile (i.e. polkadot/collator/staking_miner ones)
  • put a conditional script into ARG and tell it to run an "injection" logic or "a docker builder pattern". This would leave us with just a couple of Dockerfiles and a script, so no need to maintain pairs of similar files. From this point it becomes increasingly complicated and less readable.
  • go all-in into templating Dockerfiles and even end up removing all of them in favour of some templating language

I suggest we take the first approach and see if it's good enough.

Copy link
Contributor

@chevdor chevdor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made quite a bunch of suggestion to help with the maintenance of those images in the future.

io.parity.image.source="https://github.com/paritytech/polkadot/blob/master/scripts/docker/polkadot/polkadot_builder.Dockerfile" \
io.parity.image.documentation="https://github.com/paritytech/polkadot/scripts/docker/polkadot/README.md"

ARG PROFILE=release
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker but I ended up removing this ARG in other images as I don't think it makes much sense to build anything but a release version.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, totally, I think it was there more for explicity.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially used that when I made the first images thinking debug image could be useful but that never happened to be really the case.

scripts/docker/polkadot/polkadot_builder.Dockerfile Outdated Show resolved Hide resolved
scripts/docker/polkadot/polkadot_builder.Dockerfile Outdated Show resolved Hide resolved
scripts/docker/polkadot/polkadot_builder.Dockerfile Outdated Show resolved Hide resolved
scripts/docker/polkadot/polkadot_builder.Dockerfile Outdated Show resolved Hide resolved
scripts/docker/polkadot_injected_release.Dockerfile Outdated Show resolved Hide resolved
Copy link
Contributor

@chevdor chevdor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the big work !

LABEL io.parity.image.authors="devops-team@parity.io" \
io.parity.image.vendor="Parity Technologies" \
io.parity.image.title="builder" \
io.parity.image.description="This is the build stage for Polkadot. Here we create the binary." \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea behind it was a policy-as-a-code in future that would check that every Dockerfile has metadata. But good point on readability, makes sense to make an exclusion for the files with the specific *builder* in the name for such policy.

LABEL io.parity.image.authors="devops-team@parity.io" \
io.parity.image.vendor="Parity Technologies" \
io.parity.image.title="builder" \
io.parity.image.description="This is the build stage for Polkadot. Here we create the binary." \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's OK to have simple explanation comments instead of the full metadata in such files.

@TriplEight
Copy link
Contributor

now you should wait until #3807 gets merged

@chevdor
Copy link
Contributor

chevdor commented Sep 24, 2021

As a side note (I can open another issue if you prefer), it would be super convenient to have an injected docker image where the binary is built with all features. That would help with try-runtime for instance.

@TriplEight
Copy link
Contributor

@chevdor in another PR please

@chevdor
Copy link
Contributor

chevdor commented Sep 24, 2021

New issue about a new image with all-features: paritytech/polkadot-sdk#942

alvicsam and others added 17 commits September 24, 2021 17:13
Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
.gitlab-ci.yml Outdated Show resolved Hide resolved
@TriplEight TriplEight merged commit f6826bd into master Sep 28, 2021
@TriplEight TriplEight deleted the as-docker-chore branch September 28, 2021 15:47
ordian added a commit that referenced this pull request Sep 29, 2021
* master:
  feat: measured oneshots (#3902)
  remove `AllSubsystems` and `AllSubsystemsGen` types (#3874)
  Companion for Substrate#9867 (#3938)
  Substrate Companion for #9552 (#3834)
  CI: run disputes tests (#3962)
  Bump parity-scale-codec from 2.3.0 to 2.3.1 (#3959)
  approval-voting: populate session cache in advance (#3954)
  Bump libc from 0.2.102 to 0.2.103 (#3950)
  fix master (#3955)
  Docker files chore (#3880)
  Bump nix from 0.19.1 to 0.20.0 (#3587)
  remove connected disconnected state, 3rd attempt (#3898)
  fix flaky chain-selection tests (#3948)
  Add benchmarking for parachain runtime initializer pallet (#3913)
  minor chore changes (#3944)
  disputes: reject single-sided disputes (#3903)
ordian added a commit that referenced this pull request Sep 30, 2021
* master: (52 commits)
  Companion for substrate PR#9890 (#3961)
  Bump version, tx_version and spec_version in prep for v0.9.11 (#3970)
  Fix master compilation (#3977)
  Make most XCM APIs accept an Into<MultiLocation> where MultiLocation is accepted (#3627)
  fix disputes tests (#3974)
  Drop availability only for candidates that lose disputes (#3973)
  revert +1 change to be on the safer side (#3972)
  paras_inherent: reject only candidates with concluded disputes (#3969)
  feat: measured oneshots (#3902)
  remove `AllSubsystems` and `AllSubsystemsGen` types (#3874)
  Companion for Substrate#9867 (#3938)
  Substrate Companion for #9552 (#3834)
  CI: run disputes tests (#3962)
  Bump parity-scale-codec from 2.3.0 to 2.3.1 (#3959)
  approval-voting: populate session cache in advance (#3954)
  Bump libc from 0.2.102 to 0.2.103 (#3950)
  fix master (#3955)
  Docker files chore (#3880)
  Bump nix from 0.19.1 to 0.20.0 (#3587)
  remove connected disconnected state, 3rd attempt (#3898)
  ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants