ubccr / grendel

Bare Metal Provisioning system for HPC Linux clusters
https://grendel.readthedocs.io
GNU General Public License v3.0
57 stars 13 forks source link

http doesn't seem to be working. #29

Open richang2009 opened 1 year ago

richang2009 commented 1 year ago

Hi, http doesn't seem to be working. When I try to serve a directory using the "repo_dir" variable in the grendel.toml file, the client (compute and/or curl and wget) can't seem to download any file. Gets a 404 not found when using wget. I have never been able to server any files using http. Not in 0.0.6, not in 0.0.7 and also not in 0.0.8. Not sure if it is just me only.

Thanks, RC

aebruno commented 1 year ago

The repo_dir works as follows:

  1. Enable in grendel.toml:
# Path to repo directory
repo_dir = "/var/lib/grendel/repo"
  1. Add files to /var/lib/grendel/repo:
$ find /var/lib/grendel/repo/
/var/lib/grendel/repo/mytestfile.txt
/var/lib/grendel/repo/ubuntu
/var/lib/grendel/repo/ubuntu/ubuntu-20.04.2-live-server-amd64.iso
  1. grendel serves files via http at the /repo path. For example:
    $ curl http://x.x.x.x/repo/mytestfile.txt
    $ curl http://x.x.x.x/repo/ubuntu/ubuntu-20.04.2-live-server-amd64.iso

Can you confirm you're using the correct path?

richang2009 commented 1 year ago

I have set the repo_dir to a local directory under the user home directory. Does it have to be under /var/lib/grendel/repo only ?

Even if we set the repo_dir to /var/lib/grendel/repo, why do we need to mention http://local_IP/repo and not http://local_IP/

aebruno commented 1 year ago

I have set the repo_dir to a local directory under the user home directory. Does it have to be under /var/lib/grendel/repo only ?

No you can set it to any path on the filesystem. The default is /var/lib/grendel/repo

Even if we set the repo_dir to /var/lib/grendel/repo, why do we need to mention http://local_IP/repo and not http://local_IP/

Grendel server repo_dir under the URL path /repo. So any files in that dir will be accessible via HTTP using the /repo path. For example, http://local_IP/repo/my-file

richang2009 commented 3 months ago

I am just not able to get the http service recognize a repo dir.

Whatever repo_dir I set to, in the grendel.toml file, none of them works.

This is what I see in the log.

[2024-06-13T10:06:19+05:30] INFO PROVISION: Routes in order: [] [2024-06-13T10:06:19+05:30] INFO PROVISION: Using repo dir: [2024-06-13T10:06:19+05:30] INFO PROVISION: Listening on http://192.168.3.254:80 [2024-06-13T10:06:19+05:30] INFO PROVISION: ⇨ http server started on 192.168.3.254:80

Using curl to download the file I know it is there in the directory also doesn't work.

user@VBOXubuntu:~$ curl http://192.168.3.254/repo/test.txt {"message":"Not Found"}

[2024-06-13T10:11:24+05:30] WARN PROVISION: Requested path not found ip=192.168.3.254 path=/repo/test.txt

jafurlan commented 2 months ago

Hello, please make sure Grendel is reading the correct configuration file, you should see: INFO CLI: Using config file: /etc/grendel/grendel.toml in your logs. This can be set by executing Grendel with the -c /etc/grendel/grendel.toml flag. Also make sure the repo_dir option is both uncommented and placed under the [provision] section in said config file like so:

#------------------------------------------------------------------------------
# HTTP Provision Server
#------------------------------------------------------------------------------
[provision]
# Path to repo directory
repo_dir = "/var/lib/grendel/repo"

Then you should see this in your logs: INFO PROVISION: Using repo dir: /var/lib/grendel/repo