3889
Comment:
|
5446
gconf is good, too.
|
Deletions are marked like this. | Additions are marked like this. |
Line 11: | Line 11: |
== Known Problems == === Slave firewalls === The `dogfood` slaves have to be allowed outgoing `http` to the staging and production codehosting servers. === Slave failure handling === When the jobs fail, probably because of the missing codehosting access, they keep being restarted. This is a [[Bug:496574|known Soyuz/buildmaster bug]]. === intltool recognition === It looks like gettext has changed, and our check for intltool branches now also accepts some plain gettext branches. This happens with {{{lp:gawk}}}, which pottery mistakenly recognizes as intltool but doesn't process successfully because there is no {{{GETTEXT_PACKAGE}}} definition. |
|
Line 38: | Line 52: |
According to `wgrant`, editing `configure.ac` to set `GETTEXT_PACKAGE` ("or something like that") does the trick. | According to `wgrant`, on many branches, editing `configure.ac` to set `GETTEXT_PACKAGE` does the trick. |
Line 41: | Line 55: |
You can simulate the initial pottery compatibility check like this in `make harness`: {{{ branch = ??? # XXX: Your Branch Here. from lp.translations.model.translationtemplatesbuildjob import TranslationTemplatesBuildJob TranslationTemplatesBuildJob._hasPotteryCompatibleSetup(branch) }}} And to run templates generation, with `branch_location` being either a branch URL or a directory on your local filesystem: {{{ from lp.canonical.buildd.pottery.generate_translation_templates import GenerateTranslationTemplates script = GenerateTranslationTemplates(branch_location, 'templates.tar.gz', '/tmp') script.generate() }}} |
|
Line 43: | Line 70: |
Candidate branches: * {{{gimp}}}, but it's large. * {{{lp:ubuntu/gawk}}} does not use intltool, but pottery seems to think that it does. See [[Bug:568372|bug 568372]]. * {{{lp:libgnomeui}}}: OK, one template * {{{lp:gconf}}}: OK, one template |
|
Line 69: | Line 103: |
ORDER BY Job.id DESC | ORDER BY Job.id DESC; |
Line 74: | Line 108: |
INSERT INTO Job (status) values (0) RETURNING id | INSERT INTO Job (status) values (0) RETURNING id; |
Line 80: | Line 114: |
VALUES (<jobid>, <branchid>, 6, <json>) | VALUES (<jobid>, <branchid>, 6, <json>); |
Trying out template generation on dogfood/staging
Right now we have no good test platform for this: staging has no build farm, and dogfood has no codehosting. Expect this page to change a lot as we work and learn. We already have pages about doing this on a development system that may also help.
Approach
For now, we'll have to live with a split test setup:
Push changes to generate jobs on staging.
Copy the jobs over to the dogfood database.
Let the dogfood build farm generate the templates.
Known Problems
Slave firewalls
The dogfood slaves have to be allowed outgoing http to the staging and production codehosting servers.
Slave failure handling
When the jobs fail, probably because of the missing codehosting access, they keep being restarted. This is a known Soyuz/buildmaster bug.
intltool recognition
It looks like gettext has changed, and our check for intltool branches now also accepts some plain gettext branches. This happens with lp:gawk, which pottery mistakenly recognizes as intltool but doesn't process successfully because there is no GETTEXT_PACKAGE definition.
Checklist
Firewall
The slaves in the dogfood build farm must be allowed to make http connections to whatever codehosting server you will be using.
TODO: Ensure this—bug 499407.
Config
Make sure that generating templates is enabled in the Launchpad lazr config.
Enabled for dogfood.
- Enabled on development systems.
Being enabled for staging. TODO: what production-configs revision? How will we know it's landed?
The configuration item in question is generate_templates in the [rosetta] section.
Suitable branches
Make sure you have a branch that is pottery-compatible. (We call the code that generates templates from code "pottery"). For testing, it should normally not contain any .pot files. Otherwise we'd just end up importing those instead of ones we generated.
We don't yet know for sure what real-world branches will work right out of the box. We must fix that!
According to wgrant, on many branches, editing configure.ac to set GETTEXT_PACKAGE does the trick.
TODO: Easy litmus test to see if a branch will work with pottery. You can simulate the initial pottery compatibility check like this in make harness:
branch = ??? # XXX: Your Branch Here. from lp.translations.model.translationtemplatesbuildjob import TranslationTemplatesBuildJob TranslationTemplatesBuildJob._hasPotteryCompatibleSetup(branch)
And to run templates generation, with branch_location being either a branch URL or a directory on your local filesystem:
from lp.canonical.buildd.pottery.generate_translation_templates import GenerateTranslationTemplates script = GenerateTranslationTemplates(branch_location, 'templates.tar.gz', '/tmp') script.generate()
TODO: Find a good real-world sample branch for testing—preferably small but with multiple templates.
Candidate branches:
gimp, but it's large.
lp:ubuntu/gawk does not use intltool, but pottery seems to think that it does. See bug 568372.
lp:libgnomeui: OK, one template
lp:gconf: OK, one template
Once you have a suitable branch, you can copy it to staging's codehosting using "bzr push -d lp:<branch> lp://staging/<branch> --use-existing-dir"
Procedure
Set up a product series on both staging and dogfood.
Set up a pottery-compatible branch on staging; set it as the product series' development branch.
Register a branch on dogfood, but do not push it (as dogfood has no codehosting). Set it as the product series' development branch.
Configure translation template imports for both product series.
Push a change to your branch on staging. Wait for it to be scanned.
Once the job is scanned, a triplet of matching records should appear in the staging database: a BranchJob, a Job, and a BuildQueue. They are matched on BranchJob.job, Job.id, and BuildQueue.job. In SQL it should be at the top of...
SELECT * FROM BranchJob JOIN Job ON Job.id = BranchJob.job JOIN BuildQueue ON BuildQueue.job = Job.id WHERE BranchJob.job_type = 6 AND BuildQueue.job_type = 4 AND Job.status = 0 ORDER BY Job.id DESC;
Copy what you find directly into the dogfood database. Start with the Job:
INSERT INTO Job (status) values (0) RETURNING id;
Note the id that this returns. Now, create a BranchJob using that job id, the id of your branch on dogfood, and a copy of the json_data as created on staging:
INSERT INTO BranchJob (job, branch, job_type, json_data) VALUES (<jobid>, <branchid>, 6, <json>);
Finally, the BuildQueue entry:
INSERT INTO BuildQueue (job, job_type) VALUES (<jobid>, 4)
This should be enough to get this job onto the build farm. Keep an eye on https://dogfood.launchpad.net/builders where it should appear shortly (and then, after processing, disappear again).
Once the job is successfully completed, any generated templates should appear on the productseries' translations import queue on dogfood.