help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Show: Minimal Working Example of hpcguix-web


From: Mekeor Melire
Subject: Show: Minimal Working Example of hpcguix-web
Date: Wed, 04 May 2022 22:25:21 +0000

By the way, I got it working. Here's a minimal working example of
hpcguix-web (meant to be run in a Docker container):

--8<---------------cut here---------------start------------->8---
(use-modules
  (guix channels)           ;; channel (for hpcguix-web)
  (gnu packages certs)      ;; nss-certs
  (gnu services networking) ;; dhcp-client-service-type
  (gnu services ssh)        ;; openssh-service-type
  (gnu services web)        ;; hpcguix-web-service-type
  (gnu system image)
  (gnu))

(operating-system

  ;; this will be ignored
  (bootloader
    (bootloader-configuration
      (bootloader grub-bootloader)
      (targets '())
      (terminal-outputs '())))

  ;; this will be ignored
  (file-systems '())

  (firmware '())

  (host-name "host-name")

  ;; hpcguix-web requires pulling channels via git which requires nss-cers
  (packages (cons nss-certs %base-packages))

  (services
    (cons*

      (service hpcguix-web-service-type
        (hpcguix-web-configuration
          (specs
            #~(begin
                (use-modules (guix channels))
                (define site-config
                  (hpcweb-configuration
                    (channels
                      (cons*
                        ;; TODO: add channels here
                        %default-guix-channel))))))))

      (service dhcp-client-service-type)

      %base-services))

  ;; TODO: set timezone
  (timezone "Etc/UTC")

  (users
    (list
      ;; un-comment this user when you want to debug this os-declaration:
      ;; (user-account
      ;;   (name "debug")
      ;;   (password "debug")
      ;;   (group "users")
      ;;   (supplementary-groups
      ;;     (list "wheel" "netdev" "audio" "video")))
      )))
--8<---------------cut here---------------end--------------->8---


2022-04-27 / 21:07 / mekeor@posteo.de:

> Thank you for the hint. hpcguix-web is awesome! I installed it locally
> with the following declaration:
>
> --8<---------------cut here---------------start------------->8---
> ;; added modules: (guix channels) (gnu services web)
> (service hpcguix-web-service-type
>   (hpcguix-web-configuration
>     (specs
>       #~(define site-config
>           (hpcweb-configuration
>             (channels
>               (cons*
>                 ;; ...
>                 %default-channels
>                 )))))))
> --8<---------------cut here---------------end--------------->8---
>
> When I open the website (http://127.0.0.1:5000) in the browser, no
> packages are listed and the browser console shows 404-errors occurring
> for the following routes:
>
> http://127.0.0.1:5000/static/css/code.css
> http://127.0.0.1:5000/static/images/h-separator-darker.png
> http://127.0.0.1:5000/packages.json
> http://127.0.0.1:5000/static/images/favicon.png
>
> Does hpcguix-web depend on a web-server (like nginx) to server a certain
> folder? Or what am I missing?
>
>
>
> 2022-04-27 / 20:37 / rekado@elephly.net:
>
>> Hi Mekeor,
>>
>>> it would be nice to be able to search for a package (and/or a service)
>>> by name or description etc. through many channels. AFAIK, there's no
>>> such search engine yet. Please correct me if I'm wrong.
>>>
>>> I'm considering to implement it. I'd suggest to approach it with a
>>> server where (1) Guix is installed; (2) a long list of channels is
>>> activated; (3) a cron-job or so which regularly runs `guix pull`; (4) a
>>> web-api-service written in Guile which leverages the Guix-library in
>>> order to search for packages (-- I guess it'd be calling the
>>> `guix-package*` function from /guix/scripts/package.scm?); (5) a
>>> simplistic front-end web-site which talks to the web-api.
>>
>> See https://github.com/UMCUGenetics/hpcguix-web.  It handles the
>> constant updates to all Guix channels and the search.  You’re welcome to
>> contribute to it, e.g. to add an API, suggest changes in how results are
>> displayed, etc.
>>
>> An example deployment can be found at https://guix.mdc-berlin.de
>>
>> Guix has a service for it that makes deployment easy.
>>
>> You’ll see that it lists packages from guix-science and other channels,
>> e.g. https://guix.mdc-berlin.de/package/rstudio-server



reply via email to

[Prev in Thread] Current Thread [Next in Thread]