Skip to content
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

Skaffold doesn't display changes until restarting #1896

Closed
Hudsonzp opened this issue Mar 30, 2019 · 4 comments
Closed

Skaffold doesn't display changes until restarting #1896

Hudsonzp opened this issue Mar 30, 2019 · 4 comments

Comments

@Hudsonzp
Copy link

Hudsonzp commented Mar 30, 2019

Expected behavior

Upon skaffold syncing a file, I can refresh my browser and see the changes made to the application.

Actual behavior

Even though the file syncs and appears to be going into the proper image, no changes can bee seen until skaffold is interrupted and restarted. Most times it's 1-2 changes behind (example in steps to reproduce).

Information

  • Skaffold version: v0.26.0
  • Operating system: MacOS Mojave v10.14.3
  • Contents of skaffold.yaml:
apiVersion: skaffold/v1beta7
kind: Config
build:
  local:
    push: false
  artifacts:
    - image: test/dev-client
      docker:
        dockerfile: Dockerfile.dev
      context: ./client
      sync:
        '**/*.css': .
        '**/*.scss': .
        '**/*.js': .
    - image: test/dev-server
      docker:
        dockerfile: Dockerfile.dev
      context: ./server
      sync:
        '**/*.py': .
deploy:
  kubectl:
    manifests:
      - k8s-dev/client-cluster-ip-service.yaml
      - k8s-dev/client-deployment.yaml
      - k8s-dev/ingress-service.yaml
      - k8s-dev/server-cluster-ip-service.yaml
      - k8s-dev/server-deployment.yaml

Steps to reproduce the behavior

Page says: Success

  1. Changed in code to: Successes
  2. After syncing page says: Success
  3. Changed in code to: "This is a test for success"
  4. After syncing page says: Success
  5. --interrupt skaffold--
  6. --skaffold dev--
  7. Page says: Successes

I've tried hard refreshing, clearing cache, etc. This is happening on 2-3 different computers as well in different browsers. This happens no matter if it's a python change or a react/webpack change.

Setup:

  • Docker for Mac running my Kubernetes cluster.
  • Microservices with python/flask and react.
  • The only other Kubernetes files not included in my skaffold manifest are postgres-ip, postgres-pvc, and postgres-deployment.

Notes and Logs

Test complete in 404.419µs                                                                                     
Starting deploy...                                                                                   
kubectl client version: 1.10                                                                          
kubectl version 1.12.0 or greater is recommended for use with Skaffold                                         
service "client-cluster-ip-service" created                                     
deployment.apps "client-deployment" created                                                                    
ingress.extensions "ingress-service" created                                                                   
service "server-cluster-ip-service" created                                                                    
deployment.apps "server-deployment" created                                                                    
Deploy complete in 677.479217ms                                                                                
Watching for changes every 1s...                                                                     
Port Forwarding client-deployment-566dc9d47d-wjwd6/client 3000 -> 3000                                         
Port Forwarding server-deployment-9474c8cc-thjr4/server 5000 -> 5000                                           
Syncing 1 files for test/dev-server:16bba86063adb5a02bd80b5c1dd5fbb43b79ba0e10fb7d6fd668b32511090cbd
Watching for changes every 1s...                                                                               
Syncing 1 files for test/dev-server:16bba86063adb5a02bd80b5c1dd5fbb43b79ba0e10fb7d6fd668b32511090cbd          
Watching for changes every 1s...                                                                     
Syncing 1 files for test/dev-server:16bba86063adb5a02bd80b5c1dd5fbb43b79ba0e10fb7d6fd668b32511090cbd          
Watching for changes every 1s...                                                                               
Syncing 1 files for test/dev-server:16bba86063adb5a02bd80b5c1dd5fbb43b79ba0e10fb7d6fd668b32511090cbd
Watching for changes every 1s...

On The Python Side:

[server-deployment-9474c8cc-thjr4 server] 10.1.1.200 - - [30/Mar/2019 04:47:15] "GET /api/categories HTTP/1.1" ││200 -                            
[server-deployment-9474c8cc-thjr4 server] 10.1.1.200 - - [30/Mar/2019 04:47:15] "GET /api/reviews/recent HTTP/1││.1" 200 -        
[server-deployment-9474c8cc-thjr4 server] 10.1.1.200 - - [30/Mar/2019 04:47:15] "GET /api/things_search HTTP/1.│
│1" 200 -                                                                                    
[server-deployment-9474c8cc-thjr4 server] 10.1.1.200 - - [30/Mar/2019 04:47:15] "GET /api/things?offset=0&limit││=5 HTTP/1.1" 200 -                                                                                             
[server-deployment-9474c8cc-thjr4 server] 10.1.1.200 - - [30/Mar/2019 04:47:15] "GET /api/things_search HTTP/1.││1" 200 -

Screen Shot 2019-03-29 at 9 43 41 PM

Screen Shot 2019-03-29 at 9 44 05 PM

@Hudsonzp
Copy link
Author

Happy to provide any other files or setup information. It's such a weird issue.

@martinsoender
Copy link

I'm experiencing the same issue.

@corneliusweig
Copy link
Contributor

corneliusweig commented Mar 30, 2019

@Hudsonzp Can you make sure that you are syncing to the correct destination? Currently the way how the pattern **/*.js works is that it does not recreate subdirectories at the destination. In other words, it puts all matched files flat into the dest directory.
Please try the (currently undocumented #1837) pattern ***/*.js to achieve directory syncing. Does that solve your issue?

@Hudsonzp
Copy link
Author

Worked like a charm @corneliusweig. I swapped the pattern for py, scss, js, and my css files. First try I could refresh the page and intended changes. We can close this ticket.

Thanks for your help!

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

No branches or pull requests

3 participants