Skip to content

Fix Docker builds (armv7 && arm64)#145

Merged
madgrizzle merged 2 commits intoWebControlCNC:masterfrom
zaneclaes:master
May 22, 2020
Merged

Fix Docker builds (armv7 && arm64)#145
madgrizzle merged 2 commits intoWebControlCNC:masterfrom
zaneclaes:master

Conversation

@zaneclaes
Copy link
Copy Markdown
Member

You can test this PR with the docker images published at:

  • inzania/web-control:armv7 (tested on Rasbpian Buster Lite)
  • inzania/web-control:amd64 (tested on Ubuntu 18.04 && Mac OSX 10.15.4)

(n.b., may still be uploading; I'm on DSL and it's slow).

Thanks, maintainers, for putting this together. Just got my Maslow this week and came across your project this morning thanks to this thread — I already run a k8s cluster at my house, so wanted to deploy this via a container ;)

I assume that the fact that I've been able to connect the Maslow USB (and my camera) means it is working correctly. However, I'm just about to start calibration (just built my frame yesterday)... 😅
Screen Shot 2020-05-21 at 11 28 23 AM

Oh, and for the K8s fans out there...

apiVersion: v1
kind: Service
metadata:
  name: maslow-web-control
spec:
  selector:
    app: motion
  type: ClusterIP
  ports:
    - name: http
      port: 5000
      targetPort: http
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: maslow-web-control
spec:
  selector:
    matchLabels:
      app: maslow-web-control
  template:
    spec:
      containers:
      - name: maslow-web-control
        image: inzania/web-control:armv7
        ports:
        - containerPort: 5000
          name: http
        securityContext:
          privileged: true # Required for Serial Port access
        volumeMounts:
        - mountPath: /dev
          name: devices
        - name: cnc-data
          subPath: WebControl
          mountPath: /root/.WebControl
        env:
        - name: NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
      volumes:
      - name: devices
        hostPath:
          path: /dev
      - name: cnc-data
        persistentVolumeClaim:
          claimName: cnc
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                - key: "kubernetes.io/hostname"
                  operator: In
                  values: ["garage"]

@madgrizzle
Copy link
Copy Markdown
Collaborator

I had given up on dockers (that I know very little about) after running into problems building after I included a markdown add-on for the offline help system. Does this now work?

@zaneclaes
Copy link
Copy Markdown
Member Author

zaneclaes commented May 21, 2020

@madgrizzle could you be more specific? I detailed my testing in the PR description (and included a screenshot). If you'd like me to test other things, I'll need a little hand-holding.

@madgrizzle
Copy link
Copy Markdown
Collaborator

When webcontrol was first released a while back, it was released as a docker container for the RPI. It worked but then not many people used it because they didn't want to use an RPI.. they had linux, or windows, or mac, etc. So I looked at creating a version using pyinstaller and got it to work. I then focused on doing those releases and the docker version lagged behind. Then, at one point, I added a markdown module to allow me to create the off-line help system and when I went to build the docker, it kept failing and I couldn't figure out how to fix it. So I just stopped working on it and 'deprecated' the docker builds. So my question is does this docker version support the off-line help system (i.e., go to Help->Off-line Help)? Keep in mind I know very little about docker (I didn't create the original dockerfile.. I had someone helping at that time).

@zaneclaes
Copy link
Copy Markdown
Member Author

Here's a screenshot of that offline help running in Kubernetes:
Screen Shot 2020-05-21 at 12 18 20 PM

FWIW... this wasn't really a docker problem — this was an architecture & dependency hell problem. Nothing I fixed was specific to docker; it would have manifested on different distro's on RPis as well, depending on specific interactions between dist-upgrade version and python environment configuration. Specifically, the interaction between python2/3, armv7 and the opencv, numpy, and scipy dependencies.

@madgrizzle
Copy link
Copy Markdown
Collaborator

Awesome. Wish you had been around a year ago when I gave up on it all. Any chance you can submit something that modifies the README.md file that explains how a user can use your docker version? Is there a specific command line that's needed to run it? The whole WebMCP portion is definitely deprecated and not coming back.

@zaneclaes
Copy link
Copy Markdown
Member Author

zaneclaes commented May 21, 2020

Sure! Happy to :)

And... having this much sysadmin experience is... a dubious honor. It's a special sort of masochism that has allowed me to become passably good at these things 😛

edit I'm going to spend today calibrating my Maslow and make sure I didn't miss anything here before I wrap up the README and merge.

@madgrizzle
Copy link
Copy Markdown
Collaborator

Sounds good.. let me know if you want to join the 'org' and I'll be happy to invite you. We just created this organization and moved webcontrol out of my personal repository with hopes of getting more people, hopefully much more knowledgeable than me, involved with webcontrol.

Copy link
Copy Markdown
Collaborator

@madgrizzle madgrizzle left a comment

Choose a reason for hiding this comment

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

This works for me. I merged it locally and ran it on the RPI and didn't have any issues with websocket communications or webpages loading. Thanks!

@madgrizzle madgrizzle merged commit 85d0f0f into WebControlCNC:master May 22, 2020
@madgrizzle
Copy link
Copy Markdown
Collaborator

Hey, I did this all through the command line.. awesome. My github "level" increased by 1.

@zaneclaes
Copy link
Copy Markdown
Member Author

Haha, cool! I will definitely take you up on joining the org. LMK if you need anything for me, or can just add me. I still have to update the README and don't want to bother you with a PR when I finish it.

I only got as far as finishing attaching my sled yesterday; I'm headed to the garage now to start calibration; I just finished reading through your whole calibration thread...

@madgrizzle
Copy link
Copy Markdown
Collaborator

ANY improvements are welcome.. to anything. I'm always looking for improvement and take constructive criticism well (or at least I think I do).

@gb0101010101
Copy link
Copy Markdown
Contributor

@zaneclaes Thanks or doing this - one more thing removed from my list!
We might be able to setup GitHub Action to auto build Docker images for major releases.
Don't suppose you've done this before?
https://www.prestonlamb.com/blog/creating-a-docker-image-with-github-actions

@emilecantin
Copy link
Copy Markdown
Contributor

@gb0101010101 I'm already working on Travis builds for this; I could also add the Docker image as a build artifact as well.

@zaneclaes
Copy link
Copy Markdown
Member Author

Thanks for taking that, @emilecantin — lmk if you need any help; it's been a good 6 years since I last used Travis, though. The amd64 target is easy enough, but AFAIK you need an armv7 processor to build the armhf variants. That's easy enough if you have an RPi in your build cluster.

@gb0101010101
Copy link
Copy Markdown
Contributor

@emilecantin Yeah I would be great if we auto build and publish docker images.

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.

4 participants