mediagoblin-devel
[Top][All Lists]
Advanced

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

Re: Add cc0 license to guix package


From: Arun Isaac
Subject: Re: Add cc0 license to guix package
Date: Thu, 23 Sep 2021 18:25:03 +0530

Hi jgart,

> We're in the process of packaging GNU MediaGoblin for Guix and would like to 
> know
> what the protocol is for mentioning the license of the project's 
> documentation.

As far as I know, Guix policy is to list all licenses. This includes
documentation licenses such as GFDL and CC*. If many packages don't list
the documentation license, that is probably a bug.

> The service that you showed the other day for GeneNetwork3 might serve as
> a close model for GNU MediaGoblin since they are both python web apps that use
> a wsgi server, db, nginx, and redis. 
>
> GNU MediaGoblin uses a mysql db, nginx, redis (via celery), and waitress 
> (WSGI server).
>
> Do you happen to have that Guix System service published anywhere yet?

No, I don't have it published anywhere. For now, please find the service
definition below. Currently the service suffers from two problems: 1. it
does not register a live path with the garbage collector 2. it is too
tightly coupled with gunicorn. See the FIXME comments in the code just
before genenetwork3-shepherd-service. I will publish the service to the
guix-bioinformatics channel once I have ironed out these
difficulties. Ideas welcome!

Also note that, currently, I have not set up the db or redis. So, it
isn't really a complete genenetwork3 service.

--8<---------------cut here---------------start------------->8---
(define (profile packages)
  "Return profile with PACKAGES."
  (with-store store
    (run-with-store store
      (mlet* %store-monad ((prof-drv (profile-derivation
                                      (packages->manifest packages)))
                           (profile -> (derivation->output-path prof-drv)))
        (mbegin %store-monad
          (built-derivations (list prof-drv))
          (return profile))))))

(define (environment-with-packages packages)
  "Return environment of a profile with PACKAGES. Return value is a
list of environment variables suitable as input to the environ
function."
  (map (match-lambda
         ((search-path . value)
          (string-append (search-path-specification-variable search-path)
                         "=" value)))
       (profile-search-paths (profile packages))))

(define-record-type* <genenetwork3-configuration>
  genenetwork3-configuration make-genenetwork3-configuration
  genenetwork3-configuration?
  (package genenetwork3-configuration-package
           (default genenetwork3))
  (port genenetwork3-configuration-port
        (default 8080)))

(define %genenetwork3-accounts
  (list (user-group (name "genenetwork3")
                    (system? #t))
        (user-account
         (name "genenetwork3")
         (group "genenetwork3")
         (system? #t)
         (comment "GeneNetwork 3 user")
         (home-directory "/var/empty")
         (shell (file-append shadow "/sbin/nologin")))))

;; FIXME: Passing the environment as a list of strings means that the
;; garbage collector does not know that the profile is live. On the
;; next `guix gc', the profile will be garbage collected even if the
;; service is running.

;; FIXME: Factorize this service into two. We should have a gunicorn
;; service that is extended by the genenetwork service. This way, the
;; app is better decoupled from the deployment.
(define genenetwork3-shepherd-service
  (match-lambda
    (($ <genenetwork3-configuration> package port)
     (shepherd-service
      (documentation "Run GeneNetwork 3.")
      (provision '(genenetwork3))
      (requirement '(networking))
      (start #~(make-forkexec-constructor
                (list #$(file-append gunicorn "/bin/gunicorn")
                      "-b" #$(string-append "127.0.0.1:" (number->string port))
                      "gn3.app:create_app()")
                #:user "genenetwork3"
                #:group "genenetwork3"
                #:environment-variables
                '#$(environment-with-packages (list genenetwork3))))
      (stop #~(make-kill-destructor))))))

(define genenetwork3-service-type
  (service-type
   (name 'genenetwork3)
   (description "Run GeneNetwork 3.")
   (extensions
    (list (service-extension account-service-type
                             (const %genenetwork3-accounts))
          (service-extension shepherd-root-service-type
                             (compose list genenetwork3-shepherd-service))))
   (default-value (genenetwork3-configuration))))
--8<---------------cut here---------------end--------------->8---

Regards,
Arun

Attachment: signature.asc
Description: PGP signature


reply via email to

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