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

Deploy `resin build`docker images via `resin local push` to Local Mode devices #613

Open
niklasnorin opened this Issue Aug 9, 2017 · 15 comments

Comments

Projects
None yet
7 participants
@niklasnorin
Copy link

niklasnorin commented Aug 9, 2017

The title basically says it all, let me know if you need any clarifications.

Front logo Front conversations

@pimterry

This comment has been minimized.

Copy link
Contributor

pimterry commented Aug 9, 2017

Good idea. Sounds great to me, and I'm not immediately aware of anything that would make this especially difficult.

We've got some work upcoming to improve the CLI experience quite a bit, particularly around builds, deploys & local push - I'll make sure we consider this too as part of that (cc @shaunmulligan, @CameronDiver)

@niklasnorin

This comment has been minimized.

Copy link
Author

niklasnorin commented Sep 6, 2017

Any progress on this one? :)

@pimterry

This comment has been minimized.

Copy link
Contributor

pimterry commented Sep 11, 2017

Nothing yet I'm afraid, but I'll keep you posted.

@pimterry

This comment has been minimized.

Copy link
Contributor

pimterry commented Sep 21, 2017

@niklasnorin this is now in the current (though not definite) plan. We're aiming to remove the word local entirely, and support equivalent functionality on both resin.io and locally using resin.io appnames/UUIDs vs ips, to differentiate the two cases. For this case, that would look like:

resin build . -t myImage
resin deploy appName myImage # deploy to resin.io
resin deploy 10.0.0.10 myImage # deploy to a local device

Would that work for you? None of this is definitively confirmed, but that's the current plan we're working with, just to keep you up to date.

@niklasnorin

This comment has been minimized.

Copy link
Author

niklasnorin commented Oct 18, 2017

Been away and just got back, but I think that sounds like an excellent idea

@niklasnorin

This comment has been minimized.

Copy link
Author

niklasnorin commented Dec 1, 2017

Hi guys,

Any ETA on this feature?

Being able to build and push in the same way from our CI servers and locally would really help speed up our development while working with the same Resin primitives.

Best regards,
Niklas

@CameronDiver

This comment has been minimized.

Copy link
Contributor

CameronDiver commented Dec 4, 2017

Hey @niklasnorin

So the build + deploy functionality of the CLI is going to be overhauled, starting with the mulitcontainer update but continuing on after that. Unfortuantely I don't have any dates to give you right now, but we're in the alpha testing stages of the update (which includes CLI changes).

@curtismuntz

This comment has been minimized.

Copy link

curtismuntz commented Jul 11, 2018

Are there any updates on this feature? I create container images using a build system outside of resin build and would love to be able to use this feature.

The current resin deploy appName myImage is sufficient for deploying to production devices but proves to be too slow for my local workflow.

@pimterry

This comment has been minimized.

Copy link
Contributor

pimterry commented Jul 16, 2018

I'm afraid not @curtismuntz, but keep an eye on this issue and we'll keep you posted.

@devxpy

This comment has been minimized.

Copy link

devxpy commented Jul 21, 2018

@pimterry Is 10.0.0.10 the local ip address of the device in your example code?

$ resin deploy 192.168.1.127 iwatkie_main
ResinApplicationNotFound: Application not found: 192.168.1.127

If you need help, don't hesitate in contacting us at:

  GitHub: https://github.com/resin-io/resin-cli/issues/new
  Forums: https://forums.resin.io
$ resin deploy 10.0.0.10 iwatkie_main
ResinApplicationNotFound: Application not found: 10.0.0.10

If you need help, don't hesitate in contacting us at:

  GitHub: https://github.com/resin-io/resin-cli/issues/new
  Forums: https://forums.resin.io
@pimterry

This comment has been minimized.

Copy link
Contributor

pimterry commented Jul 23, 2018

@devxpy that's the suggestion, yes, but those are example commands for an upcoming feature. Those commands aren't something that will work right now.

resin deploy exists, but it's designed for deploying a built image via the resin.io cloud service, not to a local device.

@devxpy

This comment has been minimized.

Copy link

devxpy commented Jul 25, 2018

I did try doing a resin build on my machine, and i have to admit, it was quite slow compared to the resin servers.

The resin servers fly compared to my local machine, probably because they do the builds on fast arm servers.

Has anyone else tried a resin build on their x86 machine? How was the experience?

Resin sync is fast enough for small code-changes.

On another note, As @curtismuntz suggested, I do find it slower than the traditional "write and run" cycle. For now, I have resorted to making my applications run-able on x86.

For example, my python app uses the keyboard library to emulate GPIO when it's running on x86.

try:
    import RPi.GPIO
except (RuntimeError, ImportError):
    import keyboard

    def is_pressed():
        return keyboard.is_pressed('ctrl+alt+r')
else:
    GPIO.setmode(GPIO.BCM)
    GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP)

    def is_pressed():
        return not GPIO.input(18)
@pimterry

This comment has been minimized.

Copy link
Contributor

pimterry commented Jul 25, 2018

Hi @devxpy! That sounds interesting. The CLI issue tracker is primarily for bug reports & tracking our internal development tasks though, not discussion. Could you post this in our forums instead? That'll get a much wider audience, and I'm sure there are others there who'd be interested to discuss approaches to this.

@flipxfx

This comment has been minimized.

Copy link

flipxfx commented Oct 5, 2018

I doing something like the following

resin build . -t myApp --deviceType raspberrypi3 --arch armv7l --docker '/var/run/docker.sock'

And I would love to be able to deploy that image instead of using local push and having to rebuild the image every time.

@pdcastro

This comment has been minimized.

Copy link
Contributor

pdcastro commented Jan 16, 2019

The balena push command now supports both remote and local builds, given an app name or the IP address of a device. (Btw, resin was renamed to balena.) When given an IP address, it both builds an image and and runs a container on the device itself, which for ARM devices like the Raspberry Pi 3 can be faster than using emulators on a laptop/desktop, and sometimes faster than the balena cloud builders (I think it depends on the project, like the balance between bandwidth intensive vs CPU intensive builds, the network speed, how much of the build can be cached, and the load on the cloud ARM builders).
So potentially this issue could be closed. Comments, feedback?

@pdcastro pdcastro added question and removed platform:all labels Jan 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment