Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming binary + docker #223

Merged
merged 13 commits into from
Feb 9, 2021
Merged

Renaming binary + docker #223

merged 13 commits into from
Feb 9, 2021

Conversation

crystalin
Copy link
Collaborator

What does it do?

Rename the main binary into "moonbeam" and also provides a public docker image associated with that binary.

What important points reviewers should know?

We need to keep the previous docker image for compatibility with ops for now.

Is there something left for follow-up PRs?

The stagenet PR will need to be merged after also to keep providing the alphanet/stagenet configuration

What value does it bring to the blockchain users?

Having a better naming will avoid confusion for the users.
The new docker image will also make it easier for users to connect to one of our network.

Checklist

  • Does it require a purge of the network?
  • You bumped the runtime version if there are breaking changes in the runtime ?
  • Does it require changes in documentation/tutorials ?

@@ -106,8 +106,8 @@ pub mod opaque {

/// This runtime version.
pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("moonbase-alphanet"),
impl_name: create_runtime_str!("moonbase-alphanet"),
spec_name: create_runtime_str!("moonbeam"),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@JoshOrndorff
Will that impact the network (preventing to upgrade or ...) ? I'm not sure if the spec_name and impl_name are actually involved or just for description)..

Copy link
Contributor

Choose a reason for hiding this comment

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

Good question. I don't know. I think we should make this change either way though. Then test it out. If it rules out runtime upgrades, maybe we just purge again?

Copy link
Contributor

@JoshOrndorff JoshOrndorff left a comment

Choose a reason for hiding this comment

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

I'm a big fan of changing the binary name to moonbeam and cleaning the dockerfile. I left a little feedback below.

My biggest question is why we have two dockerfiles now.

For reference, here is Polkadot's dockerfile https://github.com/paritytech/polkadot/blob/master/docker/Dockerfile

- name: Prepare
id: prep
run: |
DOCKER_IMAGE=purestake/moonbase-parachain-testnet
DOCKER_IMAGE=purestake/moonbase-parachain
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
DOCKER_IMAGE=purestake/moonbase-parachain
DOCKER_IMAGE=purestake/moonbeam

Kind of makes sense for the image name to match the binary name.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the internal docker image. The public one is the next build step

docker/moonbase-parachain.Dockerfile Outdated Show resolved Hide resolved
@@ -4,24 +4,24 @@

FROM phusion/baseimage:0.11
LABEL maintainer "[email protected]"
LABEL description="this is the parachain node running Moonbase Alphanet"
LABEL description="this is the parachain node running Moonbase"
ARG PROFILE=release

RUN mv /usr/share/ca* /tmp && \
rm -rf /usr/share/* && \
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we just start with a slimmer base image?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What do you suggest ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I checked and it adds 20MB overhead to the binary. (total 140MB)
Not sure we can do a lot better

Copy link
Contributor

Choose a reason for hiding this comment

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

I've heard people having success with Alpine. https://hub.docker.com/_/alpine/ It claims to be only 5MB.

I'm not really saying that our image is too big as it is. I just hadn't seen anyone manually removing stuff that comes in the base image before.

Comment on lines +14 to +17
useradd -m -u 1000 -U -s /bin/sh -d /moonbase-parachain moonbeam && \
mkdir -p /moonbase-parachain/.local/share/moonbase-parachain && \
chown -R moonbeam:moonbeam /moonbase-parachain && \
ln -s /moonbase-parachain/.local/share/moonbase-parachain /data && \
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the directory still called moonbase-parachain? Why not just call it moonbeam or data.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This docker image is for ops, I kept it as close as our current process

@@ -0,0 +1,32 @@
# Node for Moonbase Alphanet.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is there a second dockerfile now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the public docker image file.
The other one (the previous one) is for internal use only

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Also I need to change the desc here

@@ -106,8 +106,8 @@ pub mod opaque {

/// This runtime version.
pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("moonbase-alphanet"),
impl_name: create_runtime_str!("moonbase-alphanet"),
spec_name: create_runtime_str!("moonbeam"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Good question. I don't know. I think we should make this change either way though. Then test it out. If it rules out runtime upgrades, maybe we just purge again?

tests/package.json Outdated Show resolved Hide resolved
@crystalin
Copy link
Collaborator Author

@purestakeoskar and @Mitchell-Grimes
So with this PR we are going to have 2 docker images for moonbeam. One is the public (which only contains the binary) and the other one is the internal one (contains the raw specs without the bootnodes).
Should we push the internal one into gcr instead of exposing it to the public ?

@crystalin crystalin marked this pull request as ready for review February 3, 2021 19:00
@crystalin
Copy link
Collaborator Author

@albertov19 this PR will change how the documentation should reference moonbeam through docker.
there will be a new public image: purestake/moonbeam which will have moonbeam as an entrypoint.
Calling docker was done like this before:

 docker run  purestake/moonbase-parachain-testnet /moonbase-alphanet/moonbase-alphanet --chain alphanet

With this new image it will be:

 docker run  purestake/moonbeam --chain alphanet

@crystalin crystalin changed the title Initial draft for renaming binary + docker Renaming binary + docker Feb 3, 2021
@crystalin crystalin merged commit 4253817 into master Feb 9, 2021
@crystalin crystalin deleted the crystalin-naming-moonbeam branch February 9, 2021 23:16
@JoshOrndorff JoshOrndorff mentioned this pull request Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants