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

Docker Version always Downloading #105

Open
gen2fish opened this issue Sep 12, 2023 · 7 comments
Open

Docker Version always Downloading #105

gen2fish opened this issue Sep 12, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@gen2fish
Copy link

gen2fish commented Sep 12, 2023

Describe the bug
Running the container in Kubernetes as a CronJob, even with back to back executions it still downloads each time.

CronJob Manifest

apiVersion: batch/v1
kind: CronJob
metadata:
  name: battlenet-lancache-prefill
spec:
  schedule: "0 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: battlenet-lancache-prefill
            image: tpill90/battlenet-lancache-prefill:latest
            args:
            - prefill
            - -p
            - wow
          restartPolicy: OnFailure

Container Log for 1st run

[2:25:33 PM] Prefilling 1 products 

[2:25:33 PM] Starting World Of Warcraft
Detecting Lancache server...
[2:25:33 PM] Detected Lancache server at level3.blizzard.com [172.20.0.12]

Getting latest config files...
Building Archive Indexes...
Determining files to download...
[2:25:48 PM] Retrieved product metadata                          15.1284
[2:25:49 PM] Downloading 84.62 GiB
Downloading..: 0%
Downloading..: 13%
Downloading..: 25%
Downloading..: 38%
Downloading..: 50%
Downloading..: 65%
Downloading..: 75%
Downloading..: 91%
Downloading..: 95%
Downloading..: 96%
Downloading..: 97%
Downloading..: 98%
Downloading..: 99%
[2:29:08 PM] Finished in 03:19.37 - 3.65 Gbit/s

[2:29:08 PM] Prefill complete! Prefilled 1 apps                  03:35.26
────────────────────────────────────────────────────────────────────────────────
  Prefilled 1 apps in 03:35.28 
                               
   Updated │ Up To Date        
  ━━━━━━━━━┿━━━━━━━━━━━━       
      1    │     0             
2023-09-12T14:29:08.643070287Z

2nd Run

[2:29:49 PM] Prefilling 1 products 

[2:29:50 PM] Starting World Of Warcraft
Detecting Lancache server...
[2:29:50 PM] Detected Lancache server at level3.blizzard.com [172.20.0.12]

Getting latest config files...
Building Archive Indexes...
Determining files to download...
[2:30:03 PM] Retrieved product metadata                          13.6584
[2:30:04 PM] Downloading 84.62 GiB
Downloading..: 0%
Downloading..: 12%
Downloading..: 25%
Downloading..: 38%
Downloading..: 50%
Downloading..: 63%
Downloading..: 75%
Downloading..: 91%
Downloading..: 95%
Downloading..: 96%
Downloading..: 97%
Downloading..: 98%
Downloading..: 99%
[2:33:33 PM] Finished in 03:29.01 - 3.48 Gbit/s

[2:33:33 PM] Prefill complete! Prefilled 1 apps                  03:43.40
────────────────────────────────────────────────────────────────────────────────
  Prefilled 1 apps in 03:43.41 
                               
   Updated │ Up To Date        
  ━━━━━━━━━┿━━━━━━━━━━━━       
      1    │     0             
2023-09-12T14:33:33.267542917Z

172.20.0.12 is the correct IP for my Lancache server

@tpill90
Copy link
Owner

tpill90 commented Sep 13, 2023

I'm not familiar with how Kubernetes works, but are the containers for this job being reused? Or run and then removed immediately?

I think I might know what's going on here, but need the above info to be sure

@gen2fish
Copy link
Author

gen2fish commented Sep 13, 2023 via email

@tpill90
Copy link
Owner

tpill90 commented May 7, 2024

Hi Chris,

Apologies for the late reply. The solution to your issue is that BattlenetPrefill has a directory where it stores various configuration, and inside that folder is a file where it keeps track of what is up to date.

The solution here will be to properly bind mount that directory. An example is in the docs Docker Setup Guide, but I'll post it here as well:

docker run -it --rm --net=host \
  --volume ~/.config/BattleNetPrefill:/Config \
  tpill90/battlenet-lancache-prefill:latest 

From the above example, the Config folder is being bound to the user's directory. You'll want to change the binding for the Config folder to wherever you want to save it.

@tpill90
Copy link
Owner

tpill90 commented May 7, 2024

I'm going to close this for now. If the above doesn't solve your issue please feel free to reopen.

@tpill90 tpill90 closed this as completed May 7, 2024
@gen2fish
Copy link
Author

I was able to implement and it works

apiVersion: batch/v1
kind: CronJob
metadata:
  name: battlenet-lancache-prefill
spec:
  schedule: "0 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: battlenet-lancache-prefill
            image: tpill90/battlenet-lancache-prefill:latest
            args:
            - prefill
            - -p
            - wow
            volumeMounts:
            - name: battlenet-pvc
              mountPath: /root/.cache/
          restartPolicy: OnFailure
          volumes:
          - name: battlenet-pvc
            persistentVolumeClaim:
              claimName: battlenet-pvc

@bedaes
Copy link

bedaes commented Jun 15, 2024

@gen2fish thx for pointing me to /root/.cache.

@tpill90 I had to mount both /Config and /root/.cache directories to have it working properly. /Config contains selectedAppsToPrefill.json whereas /root/.cache holds the BattlenetPrefill folder. But there's only /Config mentioned in the setup guide - am I doing something wrong or should /root/.cache be added to the guid? Thx!

@tpill90 tpill90 reopened this Jun 15, 2024
@tpill90 tpill90 added the bug Something isn't working label Aug 28, 2024
@tpill90
Copy link
Owner

tpill90 commented Aug 28, 2024

@gen2fish @bedaes I've given this some more thought and I realize that the reason that this is happening is a holdover behavior that was subsequently changed in SteamPrefill and EpicPrefill. Both of the other prefills track which apps are up to date in their /Config dir, while BattlenetPrefill is still storing it in it's /Cache dir. When I get a few minutes I'll update BattlenetPrefill to point to the correct directory and get a fix pushed up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants