COPY instruction different behavior with build server / resin cli

docker

#1

Hi,

Currently I have several git submodules in my root directory, and want to copy this into the container.

The docker instruction is as the following

COPY dir1/src /usr/dir1/src

Where the submodules lie inside the /dir1/src directory.
However, when I do git push to the resin app remote, the submodule directories exists, but the contents are empty.

However, when I do

sudo resin deploy <app_name> --build .

The COPY instructions work fine and the contents of the git submodules are copied properly.

Does this issue have something to do with the resin build server?

Thank you in advance.


#3

Hello @jalim, that’s because the builder doesn’t support submodules currently, so when you git push you only send the “umbrella” repository, not its submodules, so there are no files under dir1/src. The CLI doesn’t have any idea of git and merely builds what’s locally on the filesystem, hence you’re seeing it working fine.


#6

@dfunckt Thanks, that clarifies what was happening.

If the builder doesn’t support it currently, are there any plans on supporting it?


#7

@jalim, the reasons submodules aren’t supported on the builder are mostly related to how git works and there are no plans that I know of to support it. That said, you can use resin push to replace the git push workflow completely. This command does support submodules and uses the builder and supports some other goodies as well.


#8

@dfunckt Great thanks


#9

@dfunckt Speaking of resin push There are no documentation on this command and currently it stalls on

$ sudo resin push auterion_distro_nuc
Packaging the project source....

Are there any pointers for solving this issue?


#10

@jalim you would see that behaviour if your project source directory is extremely large. At that step resin-cli is packaging all of the files which are in your project directory into a tar archive, to upload to our build servers. How large is your project directory?


#11

Also, sudo is not required for resin push. You can access the documentation for this command with:

➜  ~ resin help push
Usage: push <application>

This command can be used to start a build on the remote
resin.io cloud builders. The given source directory will be sent to the
resin.io builder, and the build will proceed. This can be used as a drop-in
replacement for git push to deploy.

Examples:

	$ resin push myApp
	$ resin push myApp --source <source directory>
	$ resin push myApp -s <source directory>

Options:

    --source, -s <source>               The source that should be sent to the resin builder to be built (defaults to the current directory)

#12

@CameronDiver I have been trying to push my repo but for 30 minutes, it is still on the status as below.

Packaging the project source....

My source directory is 4.9MB

The behavior is quite different when I don’t initialize the git submodules in my source directory: It pushes right away


#13

@jalim Is your source directory still 4.9Mb after checking out the submodules?