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: Use docker or podman to build and run #88

Merged
merged 5 commits into from
Sep 30, 2021
Merged

feat: Use docker or podman to build and run #88

merged 5 commits into from
Sep 30, 2021

Conversation

rmarting
Copy link
Contributor

This PR improves the Makefile to check which container tool is installed in the enviroment (only docker or podman).

The user will not have to set up anything before to build or to run the image locally, only a container tool is needed to be installed.

HTH

@github-actions
Copy link

Thanks for making a pull request! 😃
One of the maintainers will review and advise on the next steps.

@github-actions github-actions bot added the feat label Sep 30, 2021
@rmarting
Copy link
Contributor Author

@ashokponkumar Here the PR as you request me related with konveyor/move2kube-ui#98

Ready for your review.

@rmarting
Copy link
Contributor Author

@HarikrishnanBalagopal I don't know why DCO is not passing. I followed the instructions to signoff my latest commit, but it is something not working.

From my local repo:

move2kube-api on  use-container-tool via 🐹 v1.16.8 via ⬢ v10.17.0 took 8s 
❯ git commit --amend --no-edit --signoff
[use-container-tool bfa4189] :twisted_rightwards_arrows: Merge branch 'use-container-tool' of https://github.com/rmarting/move2kube-api into use-container-tool
 Date: Thu Sep 30 12:06:19 2021 +0200
move2kube-api on  use-container-tool via 🐹 v1.16.8 via ⬢ v10.17.0 
❯ git push --force-with-lease origin use-container-tool
Enumerating objects: 1, done.
Counting objects: 100% (1/1), done.
Writing objects: 100% (1/1), 311 bytes | 311.00 KiB/s, done.
Total 1 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/rmarting/move2kube-api.git
 + c4d900a...bfa4189 use-container-tool -> use-container-tool (forced update)

What am I doing wrong?

@ashokponkumar
Copy link
Member

@HarikrishnanBalagopal I don't know why DCO is not passing. I followed the instructions to signoff my latest commit, but it is something not working.

From my local repo:

move2kube-api on  use-container-tool via 🐹 v1.16.8 via ⬢ v10.17.0 took 8s 
❯ git commit --amend --no-edit --signoff
[use-container-tool bfa4189] :twisted_rightwards_arrows: Merge branch 'use-container-tool' of https://github.com/rmarting/move2kube-api into use-container-tool
 Date: Thu Sep 30 12:06:19 2021 +0200
move2kube-api on  use-container-tool via 🐹 v1.16.8 via ⬢ v10.17.0 
❯ git push --force-with-lease origin use-container-tool
Enumerating objects: 1, done.
Counting objects: 100% (1/1), done.
Writing objects: 100% (1/1), 311 bytes | 311.00 KiB/s, done.
Total 1 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/rmarting/move2kube-api.git
 + c4d900a...bfa4189 use-container-tool -> use-container-tool (forced update)

What am I doing wrong?

Possibly one of the commits ( I guess the merge commit) does not have the sign off. Possibly you can squash and sign that commit.

feat: update go version to 1.17 (#87)

Signed-off-by: Harikrishnan Balagopal <[email protected]>

:bug: Combine 3 commits into 1

:zap: Declared container tool to build and run

Signed-off-by: Roman Martin <[email protected]>

fix: config file paths were still using ids instead of normalized names (#89)

Signed-off-by: Harikrishnan Balagopal <[email protected]>

fix: config file paths were still using ids instead of normalized names (#89)

Signed-off-by: Harikrishnan Balagopal <[email protected]>

:zap: Declared container tool to build and run

Signed-off-by: Roman Martin <[email protected]>
…es (#89)

Signed-off-by: Harikrishnan Balagopal <[email protected]>
Signed-off-by: Roman Martin <[email protected]>
@rmarting
Copy link
Contributor Author

Possibly one of the commits ( I guess the merge commit) does not have the sign off. Possibly you can squash and sign that commit.

Squash some commits into single one, but now this PR includes my changes and others coming from the main branch. TBH I don't know what it is happeing, but at least the commits include my changes.

Ready for your review.

@ashokponkumar
Copy link
Member

Possibly one of the commits ( I guess the merge commit) does not have the sign off. Possibly you can squash and sign that commit.

Squash some commits into single one, but now this PR includes my changes and others coming from the main branch. TBH I don't know what it is happeing, but at least the commits include my changes.

Ready for your review.

Can you please try a rebase with main? It shows a warning that the branch is out of date.

@rmarting
Copy link
Contributor Author

Done!

Copy link
Member

@ashokponkumar ashokponkumar left a comment

Choose a reason for hiding this comment

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

Just a nit question.

Makefile Outdated
ifdef DOCKER_CMD
${CONTAINER_TOOL} run --rm -p 8080:8080 -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}/:/workspace ${REGISTRYNS}/${BINNAME}:${VERSION}
else
${CONTAINER_TOOL} run --rm -it -p 8080:8080 --network=bridge ${REGISTRYNS}/${BINNAME}:${VERSION}
Copy link
Member

Choose a reason for hiding this comment

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

@rmarting Do we need to run with -it flag for it to work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, we don't. I use it normally but TBH for this use case it could be not needed.

Copy link
Member

Choose a reason for hiding this comment

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

Would be good to remove it, since the api container will be running in non interactive mode.

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 makes sense. Done!

Copy link
Member

@ashokponkumar ashokponkumar left a comment

Choose a reason for hiding this comment

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

Even within if block, the lines need to be tab spaced at start, otherwise it seems to get executed irrespective of whether the section is invoked or not.

Just a nit, just to make each section standout, we have refrained in general from using empty lines within each section in the makefile. If you think its okay, we can remove the empty line within the section.

Makefile Outdated
docker run --rm -p 8080:8080 -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}/:/workspace ${REGISTRYNS}/${BINNAME}:${VERSION}
crun: ## Run container image
ifndef CONTAINER_TOOL
$(error No container tool (docker, podman) found in your environment. Please, install one)
Copy link
Member

Choose a reason for hiding this comment

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

This line needs a tab space at start

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

Makefile Outdated
cpush: ## Push docker image
cpush: ## Push container image
ifndef CONTAINER_TOOL
$(error No container tool (docker, podman) found in your environment. Please, install one)
Copy link
Member

Choose a reason for hiding this comment

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

This line needs a tab space at start

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

Makefile Outdated
docker tag ${REGISTRYNS}/${BINNAME}:${VERSION} ${REGISTRYNS}/${BINNAME}:latest
cbuild: ## Build container image
ifndef CONTAINER_TOOL
$(error No container tool (docker, podman) found in your environment. Please, install one)
Copy link
Member

Choose a reason for hiding this comment

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

This line needs a tab space at start

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@ashokponkumar ashokponkumar merged commit 86175a9 into konveyor:main Sep 30, 2021
@rmarting rmarting deleted the use-container-tool branch September 30, 2021 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants