]> git.ipfire.org Git - pbs.git/commitdiff
jobs: Drop buildroots
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 8 May 2023 14:05:36 +0000 (14:05 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 8 May 2023 14:05:36 +0000 (14:05 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/buildservice/jobs.py
src/database.sql
src/templates/jobs-buildroot.html [deleted file]
src/web/__init__.py
src/web/jobs.py

index 0e90e1a42002bde8a6222d9572682a54fe976421..7dec3625f0ae37bc5713e656ea73f05ee91075e7 100644 (file)
@@ -148,7 +148,6 @@ webdir = $(buildservicedir)/web
 dist_templates_DATA = \
        src/templates/base.html \
        src/templates/index.html \
-       src/templates/jobs-buildroot.html \
        src/templates/log.html \
        src/templates/login.html \
        src/templates/queue.html \
index bad681fd50abde041a725760e2e357519c0af3d0..493187611f0aff5929a4d8402dcdb7220ca770e7 100644 (file)
@@ -792,27 +792,6 @@ class Job(base.DataObject):
                else:
                        return datetime.datetime.utcnow() - self.started_at
 
-       def save_buildroot(self, pkgs):
-               # Cleanup old stuff first (for rebuilding packages)
-               self.db.execute("DELETE FROM jobs_buildroots WHERE job_id = %s", self.id)
-
-               for pkg_name, pkg_uuid in pkgs:
-                       self.db.execute("INSERT INTO jobs_buildroots(job_id, pkg_uuid, pkg_name) \
-                               VALUES(%s, %s, %s)", self.id, pkg_name, pkg_uuid)
-
-       @lazy_property
-       def buildroot(self):
-               rows = self.db.query("SELECT * FROM jobs_buildroots \
-                       WHERE jobs_buildroots.job_id = %s ORDER BY pkg_name", self.id)
-
-               pkgs = []
-               for row in rows:
-                       # Search for this package in the packages table.
-                       pkg = self.backend.packages.get_by_uuid(row.pkg_uuid)
-                       pkgs.append((row.pkg_name, row.pkg_uuid, pkg))
-
-               return pkgs
-
        def pakfire(self, **kwargs):
                """
                        Generate the Pakfire configuration for this job
index 91c87f1c5967a4ac53e998e82623671d29f9df22..9661805ff7b4b8378abe5fe484760addf725c820 100644 (file)
@@ -421,17 +421,6 @@ CREATE VIEW public.job_queue AS
   WHERE ((jobs.deleted_at IS NULL) AND (jobs.started_at IS NULL) AND (jobs.finished_at IS NULL) AND (jobs.depcheck_succeeded IS TRUE));
 
 
---
--- Name: jobs_buildroots; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.jobs_buildroots (
-    job_id integer NOT NULL,
-    pkg_uuid uuid NOT NULL,
-    pkg_name text NOT NULL
-);
-
-
 --
 -- Name: jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
 --
@@ -1586,22 +1575,6 @@ CREATE INDEX jobs_arch ON public.jobs USING btree (arch);
 CREATE INDEX jobs_build_id ON public.jobs USING btree (build_id) WHERE (deleted_at IS NULL);
 
 
---
--- Name: jobs_buildroots_job_id; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX jobs_buildroots_job_id ON public.jobs_buildroots USING btree (job_id);
-
-ALTER TABLE public.jobs_buildroots CLUSTER ON jobs_buildroots_job_id;
-
-
---
--- Name: jobs_buildroots_pkg_uuid; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX jobs_buildroots_pkg_uuid ON public.jobs_buildroots USING btree (pkg_uuid);
-
-
 --
 -- Name: jobs_finished_at; Type: INDEX; Schema: public; Owner: -
 --
@@ -1933,14 +1906,6 @@ ALTER TABLE ONLY public.jobs
     ADD CONSTRAINT jobs_builder_id FOREIGN KEY (builder_id) REFERENCES public.builders(id);
 
 
---
--- Name: jobs_buildroots jobs_buildroots_job_id; Type: FK CONSTRAINT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.jobs_buildroots
-    ADD CONSTRAINT jobs_buildroots_job_id FOREIGN KEY (job_id) REFERENCES public.jobs(id);
-
-
 --
 -- Name: jobs jobs_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
 --
diff --git a/src/templates/jobs-buildroot.html b/src/templates/jobs-buildroot.html
deleted file mode 100644 (file)
index b93d3c9..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-{% extends "base.html" %}
-
-{% block title %}{{ _("Job buildroot")}}: {{ job.name }}{% end block %}
-
-{% block body %}
-
-       <div class="row">
-               <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
-                       <nav aria-label="breadcrumb" role="navigation">
-                               <ol class="breadcrumb">
-                                       <li class="breadcrumb-item"><a href="/">{{ _("Home") }}</a></li>
-                                       <li class="breadcrumb-item"><a href="/packages">{{ _("Packages") }}</a></li>
-                                       <li class="breadcrumb-item"><a href="/package/{{ build.pkg.name }}">{{ build.pkg.name }}</a></li>
-                                       <li class="breadcrumb-item"><a href="/build/{{ build.uuid }}">{{ build.pkg.friendly_version }}</a></li>
-                                       <li class="breadcrumb-item"><a href="/job/{{ job.uuid }}">{{ job.arch }}</a></li>
-                                       <li class="breadcrumb-item active"><a href="/job/{{ job.uuid }}/buildroot">{{ _("Buildroot") }}</a></li>
-                               </ol>
-                       </nav>
-               </div>
-       </div>
-
-       <div class="row">
-               <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
-                       <h2 style="word-wrap: break-word;">
-                               {{ _("Build job")}}: {{ job.name }}<br>
-                               <small>{{ _("Buildroot") }}</small>
-                       </h2>
-               </div>
-       </div>
-
-
-       <div class="row">
-               <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
-                       <div class="table-responsive mb-2">
-                               <table class="table table-striped table-hover">
-                                       <tr>
-                                               <td>{{ _("Packages") }}</td>
-                                               <td>{{ len(buildroot) }}</td>
-                                       </tr>
-                                       <tr>
-                                               <td>{{ _("Buildroot size") }}</td>
-                                               <td>{{ format_size(buildroot_size) }}</td>
-                                       </tr>
-                                       <tr>
-                                               <td>{{ _("Download size") }}</td>
-                                               <td>{{ format_size(download_size) }}</td>
-                                       </tr>
-                               </table>
-                       </div>
-               </div>
-       </div>
-
-       <div class="row">
-               <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
-                       <h4 style="word-wrap: break-word;">
-                               {{ _("The packages listed below were used to build %s.") % job.name }}
-                       </h4>
-               </div>
-       </div>
-
-       <div class="row">
-               <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
-                       <div class="table-responsive mb-2">
-                               <table class="table table-striped table-hover">
-                                       <tbody>
-                                               {% for name, uuid, pkg in buildroot %}
-                                                       <tr>
-                                                               {% if pkg %}
-                                                                       <td>
-                                                                               <a href="/package/{{ pkg.uuid }}">{{ pkg.friendly_name }}</a>
-                                                                       </td>
-                                                                       <td>
-                                                                               {{ pkg.summary }}
-                                                                       </td>
-                                                                       <td>
-                                                                               {{ format_size(pkg.filesize) }}
-                                                                       </td>
-                                                               {% else %}
-                                                                       <td>
-                                                                               {{ name }}
-                                                                       </td>
-                                                                       <td>
-                                                                               ({{ uuid }})
-                                                                       </td>
-                                                                       <td>
-                                                                               {{ _("N/A") }}
-                                                                       </td>
-                                                               {% end %}
-                                                       </tr>
-                                               {% end %}
-                                       </tbody>
-                               </table>
-                       </div>
-               </div>
-       </div>
-{% end block %}
index 778e5a7ba3851c35d1a2cb2d99cf461fed85c6c6..8d896e4934fadd5f7002ac4e0381fcd5769c1f27 100644 (file)
@@ -145,7 +145,6 @@ class Application(tornado.web.Application):
                        (r"/jobs/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/abort", jobs.AbortHandler),
                        (r"/jobs/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/log", jobs.LogHandler),
                        (r"/jobs/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/retry", jobs.RetryHandler),
-                       (r"/job/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/buildroot", jobs.JobBuildrootHandler),
                        (r"/api/v1/jobs/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})",
                                jobs.APIv1ControlHandler),
                        (r"/api/v1/jobs/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/finished",
index fae68cbf19821c4f323479043ca90a94cd31af88..f15621eba73450499689ccee68629aa784f05b9d 100644 (file)
@@ -170,28 +170,6 @@ class LogHandler(base.BaseHandler):
                        self.write(line)
 
 
-class JobBuildrootHandler(base.BaseHandler):
-       def get(self, uuid):
-               job = self.backend.jobs.get_by_uuid(uuid)
-               if not job:
-                       raise tornado.web.HTTPError(404, "Job not found: %s" % uuid)
-
-               # Calculate the download size and buildroot size.
-               download_size = 0
-               buildroot_size = 0
-
-               for name, uuid, pkg in job.buildroot:
-                       if not pkg:
-                               continue
-
-                       download_size += pkg.filesize
-                       buildroot_size += pkg.size
-
-               self.render("jobs-buildroot.html", job=job, build=job.build,
-                       buildroot=job.buildroot, download_size=download_size,
-                       buildroot_size=buildroot_size)
-
-
 class AbortHandler(base.BaseHandler):
        @tornado.web.authenticated
        def get(self, uuid):