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

feat: Add git flow to make docker image #157

Merged
merged 3 commits into from
Jul 5, 2021
Merged

feat: Add git flow to make docker image #157

merged 3 commits into from
Jul 5, 2021

Conversation

gyuguen
Copy link
Contributor

@gyuguen gyuguen commented Jul 5, 2021

When master branch changed and add new tag then build docker image and publish git package.
There were a few things to consider.

  • Required of wasmvm module libwasmvm.so library
  • docker image build and publish(link)

@gyuguen gyuguen requested a review from youngjoon-lee July 5, 2021 00:26
@gyuguen gyuguen requested a review from cl9200 as a code owner July 5, 2021 00:26
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
Copy link
Contributor

@youngjoon-lee youngjoon-lee Jul 5, 2021

Choose a reason for hiding this comment

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

Is there any reason why use a specific commit hash instead of the semver docker/login-action@v1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an automatically generated hash.
I will test it after changing it to the latest version!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated current tag and the test result was successful in upload the git package.
Thank you review.

RUN make clean && make build

# Get 'libwasmvm.so' from wasmvm
RUN git clone -b v0.14.0 https://github.com/CosmWasm/wasmvm.git /src/wasmvm
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah. There's no other way to get libwasmvm.so because CosmWasm/wasmvm is indirectly referred by panacea-core (The panacea-core refers to CosmWasm/wasmd which refers to CosmWasm/wasmvm).

Now, we must keep in mind that the version of wasmvm must be always updated whenever we update the wasmd (in the go.mod).

Btw, I just found that the wasmvm also provides a libwasmvm_muslc.a for Alpine Linux.
https://github.com/CosmWasm/wasmd/blob/d2e35c249e39e90c5a85e03e0b75800431612b20/Dockerfile#L18
It would be better to use that, but not for now because that's a static library (not a shared library). It means that we have to change our Makefile to build the panacead with the static library. So, let's do it later. For now, your strategy is good enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK!

RUN make clean && make build

# Get 'libwasmvm.so' from wasmvm
RUN git clone -b v0.14.0 https://github.com/CosmWasm/wasmvm.git /src/wasmvm
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is same version used by wasmd(v0.17.0)
If change the wasmd version, wasmvm version needs to be update too.

Comment on lines +56 to +59
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Aha. I got it.

To check if I understood it correctly, the docker image will be pushed:

  • When the master branch is updated, an image is pushed with the tag master.
  • Or,
  • When the vX.Y.Z git tag is created, an image is pushed with the tag vX.Y.Z and the latest docker tag is updated.

Is it right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's right.�
I test my packages.
스크린샷 2021-07-05 오전 10 14 58

Copy link
Contributor

@youngjoon-lee youngjoon-lee left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@gyuguen gyuguen merged commit ebe7145 into medibloc:master Jul 5, 2021
@gyuguen gyuguen linked an issue Jul 5, 2021 that may be closed by this pull request
@youngjoon-lee youngjoon-lee added this to the v2.0.0 milestone Jul 12, 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.

Add docker git workflow
2 participants