Git Product home page Git Product logo

node-kubycat's People

Contributors

hweissig avatar sheldonjuncker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

node-kubycat's Issues

Problems with sync-on-start when using build-cache-on-start

Hello,

I don't know what is going on but want to share this special case which seems not to work as expected

# config.yaml
kubycat:
  namespace: my-app-namespace
  sync:
  - name: my-app
    base: /home/myhome/MyApp
    from:
    - src
    - frontend-dist
    - Project.toml
    to: /home/myhome/MyApp
    pod-label: app.kubernetes.io/name=my-app
    shell: /bin/sh
    # Allows Kubycat to send desktop notifications on errors
    notify: true
    # Whether to show the logs for the sync
    show-logs: true
    # Sync files on startup
    sync-on-start: true
    # Build file caches on startup to prevent unintentional syncing
    # build-cache-on-start: true


  - name: MyApp.toml
    base: /home/myhome/MyApp/dev
    from:
    - MyApp.toml
    to: /home/myhome
    pod-label: app.kubernetes.io/name=my-app
    shell: /bin/sh
    # Allows Kubycat to send desktop notifications on errors
    notify: true
    # Whether to show the logs for the sync
    show-logs: true
    # Sync files on startup
    sync-on-start: true
    # Build file caches on startup to prevent unintentional syncing
    # build-cache-on-start: true

If I set build-cache-on-start: true to true for both, the second part is not synced on start. If I change the MyApp.toml file it will then get synced, but the initial sync does not happen. If I uncomment the build-cache-on-start option as above, everythings works correctly. (Hence this is also my workaround for now).

It would be great if build-cache-on-start works together with sync-on-start.

I hope this information can help

parallelize kubycat?

if many files change the same time it seems that kubycat is sequentially pushing the changes one after the other

that is very slow. It would be great if this could be parallelized

Support commandline arguments

It would be great to have a flexible option to set config.yaml properties via the commandline.

Something like

kubycat path/to/baseconfig.yaml --set kubycat.sync[0].pod-label="mylabel1=myvalue1"

Support multiple pod-labels

Pods may have multiple labels like environment, application, etc. which combination makes it a unique match.

Currently it seems only a single pod-label is allowed.

Linux support?

I getting error trying kubycat on my linux machine

TypeError [ERR_FEATURE_UNAVAILABLE_ON_PLATFORM]: The feature watch recursively is unavailable on the current platform, which is being used to run Node.js
    at new NodeError (node:internal/errors:405:5)
    at Object.watch (node:fs:2416:11)
    at Kubycat.watchFiles (/home/myhome/.npm-packages/lib/node_modules/kubycat/dist/cjs/Kubycat.js:56:46)
    at Kubycat.<anonymous> (/home/myhome/.npm-packages/lib/node_modules/kubycat/dist/cjs/Kubycat.js:90:18)
    at Generator.next (<anonymous>)
    at /home/myhome/.npm-packages/lib/node_modules/kubycat/dist/cjs/Kubycat.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/home/myhome/.npm-packages/lib/node_modules/kubycat/dist/cjs/Kubycat.js:4:12)
    at Kubycat.start (/home/myhome/.npm-packages/lib/node_modules/kubycat/dist/cjs/Kubycat.js:89:16)
    at KubycatCli.main (/home/myhome/.npm-packages/lib/node_modules/kubycat/dist/cjs/KubycatCli.js:39:17) {
  code: 'ERR_FEATURE_UNAVAILABLE_ON_PLATFORM'
}

Node.js v18.17.1

the error brought me to this stackoverflow which says that the recursive option seems unsupported on linux.

What to do? Is this just not working linux?

Problems with sync-on-start when using build-cache-on-start

Hello,

I don't know what is going on but want to share this special case which seems not to work as expected

# config.yaml
kubycat:
  namespace: my-app-namespace
  sync:
  - name: my-app
    base: /home/myhome/MyApp
    from:
    - src
    - frontend-dist
    - Project.toml
    to: /home/myhome/MyApp
    pod-label: app.kubernetes.io/name=my-app
    shell: /bin/sh
    # Allows Kubycat to send desktop notifications on errors
    notify: true
    # Whether to show the logs for the sync
    show-logs: true
    # Sync files on startup
    sync-on-start: true
    # Build file caches on startup to prevent unintentional syncing
    # build-cache-on-start: true


  - name: MyApp.toml
    base: /home/myhome/MyApp/dev
    from:
    - MyApp.toml
    to: /home/myhome
    pod-label: app.kubernetes.io/name=my-app
    shell: /bin/sh
    # Allows Kubycat to send desktop notifications on errors
    notify: true
    # Whether to show the logs for the sync
    show-logs: true
    # Sync files on startup
    sync-on-start: true
    # Build file caches on startup to prevent unintentional syncing
    # build-cache-on-start: true

If I set build-cache-on-start: true to true for both, the second part is not synced on start. If I change the MyApp.toml file it will then get synced, but the initial sync does not happen. If I uncomment the build-cache-on-start option as above, everythings works correctly. (Hence this is also my workaround for now).

It would be great if build-cache-on-start works together with sync-on-start.

I hope this information can help

Both ways sync

Thank you for this great tool. Have you considered syncing both ways?
To me that would be very usefull, as the changes made in the pod would come back on my local machine, and I would be able to manage my versionning locally.

syncronization issues

I am using parcel to build javascript into a frontend-dist directory.

The routine will first delete the folder and then recreate it with all new files.
Somehow kubycat is not able to correctly syncronize the files respectively (this frontend-dist directory is listed under the yaml key from:)

When restarting kubycat (sync-on-start is activated), everything is correct.

I hope this information can help finding the bug/missing feature

Syncing multiple pods with the same settings fails

I am trying to sync multiple pods with the following configuration:

kubycat:
  namespace: default
  sync:
    - name: multi-sync
      base: /my/base/directory
      from:
        - foo
        - bar
        - manage.py
      to: /code
      pod-label: code.watcher=true
      shell: /bin/sh

When kubycat sees any file changes it shows the following output:

sync	/my/base/directory/manage.py
 - sync=multi-sync
 - status=Modified
 - kubectl --namespace default get pods -l code.watcher=true -o custom-columns=NAME:metadata.name --no-headers
 - running on all 1 pods
 - kubectl --namespace default cp /my/base/directory/manage.py default/pod1-0 pod2-0:/code/manage.py
  - error:
 ---------------------------------------
 - error: one of src or dest must be a remote file specification
 - /bin/sh: line 1: django-st3-celery-worker-0:/code/manage.py: No such file or directory
 ---------------------------------------
 - exiting with code 127...

Note that it claims to have only found one pod but kubectl --namespace default get pods -l code.watcher=true -o custom-columns=NAME:metadata.name --no-headers gives me:

pod1-0
pod2-0

(All names have been changed to protect the innocent)

filenames with spaces lead to error: source and destination are required

Every time kubycat tries to syncronize a single file called saving and loading.jl it fails with

- error:
 ---------------------------------------
 - error: source and destination are required
 ---------------------------------------
 - exiting with code 1...

I guess it is because of whitespace issues.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.