Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Testnet: add new container for build #703

Merged
merged 3 commits into from
Sep 8, 2017

Conversation

MoroccanMalinois
Copy link
Contributor


By submitting this pull-request, I confirm the following:

  • I have read and understood the contributor guide in kovri-docs.
  • I have checked that another pull-request for this purpose does not exist.
  • I have considered and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used and that this pull-request may be closed by the will of the maintainer.
  • I give this submission freely under the BSD 3-clause license.

To avoid rebuilding the docker image for each git revision, the user can now choose to "Use binaries from repo" during testnet creation.

To rebuild the binaries:

testnet.sh exec make

Or get a shell first:

testnet.sh exec sh

and then

 make

@MoroccanMalinois
Copy link
Contributor Author

MoroccanMalinois commented Sep 6, 2017

In addition, in the new dockerfile, maybe we could also add gdb (i took the liberty to add iptables as my next PR will require it).

Just an fyi, whatever the size of the image, it doesn't change the size of instances (as it uses AUFS EDIT: or OverlayFS now ), so the impact of the docker image size on testnet is quite limited.

Copy link
Collaborator

@anonimal anonimal left a comment

Choose a reason for hiding this comment

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

Referencing our #kovri-dev chat for this feature. Thank you @MoroccanMalinois.

On a related sidenote, could you please add the license to the testnet file for this PR (I should've added it to #702)?

esac
fi

mount_repo_bins=""
Copy link
Collaborator

Choose a reason for hiding this comment

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

mount_repo_bins=""

I don't think this is necessary. Did you find this necessary?

mount_repo_bins=""
if [[ "$KOVRI_USE_REPO_BINS" = true ]]; then
mount_repo_bins="-v ${KOVRI_REPO}/build/kovri:/usr/bin/kovri -v ${KOVRI_REPO}/build/kovri-util:/usr/bin/kovri-util"

Copy link
Collaborator

Choose a reason for hiding this comment

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

If we're going to start bool'ing, how about we create bool vars for building? This [bool'ing] can then be applied elsewhere so we never have to enter keyboard input once they are all set.

What do you think? If we apply elsewhere, I think it should be in a separate commit.

-w /home/kovri/kovri \
$KOVRI_IMAGE \
$@
catch "Failed to run a shell"
Copy link
Collaborator

Choose a reason for hiding this comment

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

"Failed to run a shell"

But this could be a failed docker run too?

@anonimal
Copy link
Collaborator

anonimal commented Sep 6, 2017

Hi @MoroccanMalinois, I just saw these:

In addition, in the new dockerfile, maybe we could also add gdb (i took the liberty to add iptables as my next PR will require it).

Ok, sounds good. Since it's dev-only, let's do what we need.

Just an fyi, whatever the size of the image, it doesn't change the size of instances (as it uses AUFS EDIT: or OverlayFS now ), so the impact of the docker image size on testnet is quite limited.

I'm more concerned about how we manage logging. Even without debug levels, there's a lot of writing. I have some ideas on potential resolutions, will talk more in #kovri-dev.

MoroccanMalinois added a commit to MoroccanMalinois/kovri that referenced this pull request Sep 7, 2017
MoroccanMalinois added a commit to MoroccanMalinois/kovri that referenced this pull request Sep 7, 2017
MoroccanMalinois added a commit to MoroccanMalinois/kovri that referenced this pull request Sep 7, 2017
MoroccanMalinois added a commit to MoroccanMalinois/kovri that referenced this pull request Sep 7, 2017
@MoroccanMalinois
Copy link
Contributor Author

Thanks @anonimal. Ready for review

@@ -101,7 +140,16 @@ set_image()
KOVRI_IMAGE=${_default_image}
fi

read_input "Build Kovri Docker image? [$KOVRI_IMAGE]" NULL "docker build -t $KOVRI_IMAGE $KOVRI_REPO"
# Select Dockerfile
local _default_dockerfile="Dockerfile"
Copy link
Collaborator

Choose a reason for hiding this comment

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

May as well change to Dockerfile_dev since this is testnet. Yes/no?

mount_repo_bins="-v ${KOVRI_REPO}/build/kovri:/usr/bin/kovri \
-v ${KOVRI_REPO}/build/kovri-util:/usr/bin/kovri-util"

read_bool_input "Build repo binaries?" KOVRI_BUILD_REPO_BINS "Exec make"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Re: our debugging in #kovri-dev, any objection to making this a release-static build?

@@ -74,6 +100,19 @@ set_repo()
fi
}

set_bins()
{
read_bool_input "Use binaries from repo?" KOVRI_USE_REPO_BINS ""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add a note to the question (or somewhere) about ensuring that the binaries are built statically if not built within the container?

MoroccanMalinois added a commit to MoroccanMalinois/kovri that referenced this pull request Sep 7, 2017
MoroccanMalinois added a commit to MoroccanMalinois/kovri that referenced this pull request Sep 7, 2017
MoroccanMalinois added a commit to MoroccanMalinois/kovri that referenced this pull request Sep 8, 2017
MoroccanMalinois added a commit to MoroccanMalinois/kovri that referenced this pull request Sep 8, 2017
Copy link
Collaborator

@anonimal anonimal left a comment

Choose a reason for hiding this comment

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

@anonimal anonimal merged commit 446d43d into monero-project:master Sep 8, 2017
anonimal added a commit that referenced this pull request Sep 8, 2017
446d43d Testnet: (#703) use boolean vars for cleanup and image build (MoroccanMalinois)
2e9341b Testnet: (#703) add container for rebuild (MoroccanMalinois)
b360ec5 Testnet: (#703) add license (MoroccanMalinois)
@MoroccanMalinois MoroccanMalinois deleted the dock_builder branch September 8, 2017 01:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants