Difference between pages "Funtoo:About/pt-br" and "Portage Git Mirror"

(Difference between pages)
(Posso Usá-lo (Can I Use It)?)
 
m (found the --sync settings for portage in the install guide)
 
Line 1: Line 1:
= Visão do Projeto =
+
=Setting up local git mirror =
  
Daniel Robbins originalmente escreveu a [[ Gentoo Linux Philosophy|Filosofia Gentoo Linux]], e nisso definiu o conceito de uma ferramenta ideal assim sendo algo que "simplesmente funciona", não fica no caminho do usuário, e responde a vontade do usuário ao invés de forçar o usuário a trabalhar de um jeito particular.
+
This tutorial explains how to save bandwidth when several local computers need to pull updates from a single remote git repository.
  
Funtoo Linux é um projeto de pessoas que concordam filosofia da ferramenta ideal, e que são ''apaixonados'' pelo nosso desejo de melhorar a tecnologia de ser tão próximo desse ideial quanto possível. O foco de nossos esforços é o melhoramento contínuo da distribuição Gentoo Linux.
+
== Use case ==
  
O foco do desenvolvimento do Funtoo Linux é atualmente direcionado ao sistema central (core system), significando qualquer coisa em um stage3, portage, core languages, kernels, aplicações de servidor, e em cima do X11 e gerenciadores de janelas simples, e incluindo ambientes desktop como o GNOME e o KDE.
+
This tutorial will be about hosting a local mirror of funtoo git based portage tree.
  
== Foco, Foco, Foco ==
+
Following terms should be adapted
  
Desenvolvedores deveriam utilizar esses princípios gerais para determinar em quais prioridades focar primeiro. -Essas areas abaixo estão listadas em ordem de prioridade, então o próximo parágrafo é a principal prioridade (top priority), seguido pela próxima prioridade, etc. Só por que algo é prioridade mais baixa não significa que é "menos importante" - somente significa tratar as coisas de prioridades mais altas (higher-priority) antes.
+
{{TableStart}}
 +
<tr class="header">
 +
<th align="left">Terms</th>
 +
<th align="left">Definition</th>
 +
</tr>
 +
<tr class="odd">
 +
<td align="left">git.lan</td>
 +
<td align="left">The git-daemon local mirror host</td>
 +
</tr>
 +
<tr class="even">
 +
<td align="left">localhost</td>
 +
<td align="left">Any local host</td>
 +
</tr>
 +
<tr class="odd">
 +
<td align="left">nobody</td>
 +
<td align="left">Owner user of .git files</td>
 +
</tr>
 +
<tr class="even">
 +
<td align="left">/home/git-mirrors</td>
 +
<td align="left">Base path of git-daemon</td>
 +
</tr>
 +
{{TableEnd}}
  
=== Ele controe (Does it Build)? ===
+
== Local mirror ==
  
* '''Ele constrói confiavelmente?'''
+
==== Prepare directories and get portage tree====
 +
<console>
 +
###i## mkdir /home/git-mirrors
 +
###i## chown nobody /home/git-mirrors
 +
###i## su -s /bin/sh nobody
 +
$##bl## cd /home/git-mirrors
 +
$##bl## git clone --mirror --bare git://github.com/funtoo/ports-2012.git portage.git
 +
</console>
 +
For a security reason we use a nobody user .
 +
==== git-daemon configuration====
 +
{{file|name=/etc/conf.d/git-daemon|desc=|body=
 +
GITDAEMON_OPTS="--syslog --verbose --enable=receive-pack --export-all"
 +
GITDAEMON_OPTS="${GITDAEMON_OPTS} --base-path=/home/git-mirrors /home/git-mirrors --interpolated-path=/home/git-mirrors"
 +
GIT_USER=nobody
 +
GIT_GROUP=nobody
 +
}}
  
O primeiro teste - o software constrói a partir do código fonte corretamente? Isso não se trata somente de emergir ebuilds no seu sistema -- O builds do stage funciona sem problemas utilizando o Metro? Se não, isso precisa ser corrigido primeiro. O Funtoo Linux continuamente constrói lançamentos de do sistema operacional atualizados, e essa devem ser construídas confiavelmente em todos os momentos. O fóco aqui é para builds 100% corretos e eficientes utilizando o Metro, e depois emergindo aplicações iniciais em um sistema Funtoo Linux.
+
====Service configuration====
 +
To start daemon with a mirror machine boot add <code>git-daemon</code> to default runlevel
 +
<console>
 +
###i## rc-update add git-daemon default
 +
</console>
 +
To make changes start immediately just run <code>rc</code>
 +
<console>
 +
###i## rc
 +
</console>
  
=== Ele executa (Does It Run)? ===
+
=== Pull from remote ===
  
* '''Ele executa bem?'''
+
Add the following to <code>/etc/cron.daily/funtoo-sync.sh</code>:
  
OK, ele constrói. Ele executa corretamente? Ele funciona? Isso é bem vago, então vamos colocar algumas especificações aqui. Quando instalar o Funtoo Linux a partir do stage3, tudo funciona? Quais complicações ou falhas foram  encontradas na instalação inicial? Essas devem ser corrigidas, ou soluções devem ser colocadas no lugar, e correções a longo prazo devem ser trabalhadas para melhorar a experiência do usuário. Lembre-se de que o foco do Funtoo Linux é no sistema central - Essa é a coisa que você toca quando você instala o Funtoo Linux pela primeira vez. Você deve reinstalar o Funtoo Linux regularmente para verificar por quaisquer questões e priorizar as questões de instalação do usuário e a experiência inicial do usuário.
+
<pre>
 +
#!/bin/sh
 +
cd /home/git-mirrors/portage.git
 +
su nobody -s "/bin/sh" -c "git fetch"
 +
</pre>
  
=== Posso Usá-lo (Can I Use It)? ===
+
== Cloning from local git-daemon ==
  
* '''Facilmente (Easily)?'''
+
Local clone from <code>git.lan</code>:
* '''Para Trabalho de Verdade (For Real Work)?'''
+
<console>
 +
###i## mv /usr/portage /usr/portage.old
 +
###i## git clone git://git.lan/portage.git /usr/portage
 +
###i## cd /usr/portage
 +
###i## git checkout funtoo.org
 +
</console>
  
OK, ele constrói, e executa. Mas eu posso realizar tarefas de verdade com a ferramenta? Qual é a facilidade ou dificuldade  de realizar essas tarefas? A tecnologia (e documentação) devem ser projetadas oferecer suporte ao usuário na questão de realizar estas tarefas, ao invés de forçar o usuário a saltar por arcos obter algo configurado corretamente. As coisas devem ser automatizadas o tanto o quanto possível sem assumir controle distante do usuário. Razoável, padrões seguros que são adequados para a cargas produtivas devem ser utilizadas por todas as aplicações. As coisas devem emergir sem bloqueadores ou ausência de recursos que devem ser habilitadas manualmente pelo usuário. E uma implicância - se o emerge parar de dizer ao usuário que eles devem definir uma variável USE para que continue, isso é algo que deve ser corrigido de um jeito ou de outro. Então, quando tudo é dito e feito, ele deve funcionar.
+
== Downstream Clients Settings ==
 +
{{file|name=/etc/portage/make.conf|lang=|desc=define client sync source for emerge --sync|body=
 +
SYNC="git://git.lan/portage.git"}}
  
=== Is It Documented? ===
+
[[Category:HOWTO]]
 
+
* '''For free software projects, documentation is key.'''
+
 
+
If software builds, runs and works, others still may not be able to use it until proper documentation is available. Upstream documentation isn't always complete or easy to understand, so often additional user documentation is required. If manual steps are required, they should be documented clearly and correctly. The documentation option of choice is the Funtoo wiki as well as man pages.
+
 
+
For source code, verbose comments should be used. You may be working on the code now, but someone else might be working on it six months from now. Developers are expected to write clear comments that are sufficiently non-technical and provide the necessary context to allow less experienced developers to understand critical parts of code, and ideally '''all''' parts of the code. Please see [[Coding Standards]].
+
 
+
=== Is It Well-Designed? ===
+
 
+
* '''Optimized?'''
+
* '''Maintainable?'''
+
 
+
It builds and runs, and I can use it to perform real work. But is the system well-designed? Does it work reliably? Are all available patches and fixes in place to ensure a reliable computing experience? Is Funtoo Linux providing the best technology possible to users? And is this technology easy to maintain? Remember, all things being equal, less code is better than more code because it is easier to maintain. Are there verbose comments in code where necessary?
+
 
+
=== Are We Getting Better? ===
+
 
+
OK, we're doing all of the above steps. Here is the next test - are we getting better? Is the quality, security, usability and maintainability of the distribution improving over time, or is it going up, and then going down, and we're not really making any forward progress? The ultimate goal at the end of the day is to make forward progress in the quality of the distribution. This requires better automation, better tools, better processes, and investment in research and development and new ways of doing things. It also requires the right attitude. If we are doing a lot of work and the overall quality of the distribution is not improving, then our efforts are not making a long-term difference, even though they may be addressing immediate bugs and issues. We must ensure that our efforts are worthwhile, and they are making a positive long-term difference in the quality of the distribution.
+
 
+
=== What is The Real Problem? ===
+
 
+
Building on this theme - when a bug is encountered, what is the ''real'' problem, or ''root cause''? Strategic thinking as well as in-depth troubleshooting is required to identify the root cause of a problem. Should we just fix root causes? No, this is impractical, because doing this takes a lot of time. Instead, workarounds are often used to quickly restore quality to acceptable levels. However, just implementing workarounds is dangerous, because bugs tend to multiply while the underlying issue goes unresolved. The proper solution is to implement workarounds but to not lose focus on the need to address the underlying issues, or root causes, of the problem. In fact, much of the focus of Funtoo Linux is on this last step - aggressively fixing a bunch of immediate issues so we can start to address the deeper problems once and for all...
+
 
+
=== Architecture ===
+
 
+
...and addressing root causes of problems often requires a significant change in software architecture. Funtoo Linux is a project that is not afraid of making significant, even aggressive, architectural changes in order to fix problems. This is what our users expect us to do, and ''as long as these changes are properly tested, managed, planned, automated and communicated to users'', they will not get upset. As stated in the previous paragraph, the Funtoo Linux project is zealous about addressing these core architectural issues -- but we need to get a handle on the more fundamental challenges first. Once workarounds are in place, we'll take a stab at some core system change that will pay dividends well into the future.
+
 
+
== Examples ==
+
 
+
Below, you will find examples of existing efforts that have aligned with these goals. This section will give you a feel for how real projects can be started that align with the Funtoo Linux vision defined above.
+
 
+
=== Boot-Update ===
+
 
+
[[Boot-Update]] was designed by Daniel Robbins to provide a more elegant way to configure boot loaders under Funtoo Linux. This project was prioritized for several reasons. For one, it had to do with the initial installation experience (see [[#Does it Run?]]) Also, lack of GRUB2 support, as well as GPT/GUID support, was identified as a critical weakness in current Gentoo Linux functionality (see [[#Is it Well-Designed?]]) Because of this, a new unified configurator was written which uses <tt>/etc/boot.conf</tt> as the global boot loader configuration file. This represented a change in boot loader architecture (see [[#Architecture]]) under Funtoo Linux, in order to improve usability and flexibilty over existing solutions, and to attempt to reduce or eliminate a class of problems related to boot loader configuration, which is especially troublesome with GRUB2.
+
 
+
=== Metro ===
+
 
+
[[Metro]] was designed by Daniel Robbins and is used to address the "[[#Does It Build?]]" question. The existing solution, catalyst, was difficult to maintain (see [[#Is It Well-Designed?]]), so Metro was developed to provide a new mechanism for building OS releases.
+
 
+
=== Forked Ebuilds ===
+
 
+
Not all improvements involve large software development efforts. In fact, the majority of fixes involve relatively small fixes to ebuilds. These fixes are often made to fix a Metro build failure (see [[#Does it Build?]]) or address some quality issue (see [[#Is It Well-Designed?]]). The <tt>www-servers/nginx</tt> ebuild was improved to provide better default settings for production systems, with corresponding changes made to <tt>sys-libs/pam</tt> to allow this to work. <tt>dev-lang/python</tt> contains fixes to ensure that Metro builds complete properly and a valid <tt>/usr/bin/python</tt> symlink always exists.
+
 
+
=== OpenVZ ===
+
 
+
OpenVZ support is a specific priority of Funtoo Linux. Funtoo Linux maintains a patched <tt>sys-cluster/vzctl</tt> with various patches to fix a variety of problems. In addition, <tt>openvz-rhel6-stable</tt> and <tt>openvz-rhel5-stable</tt> ebuilds have been created to ease installation of production-quality OpenVZ kernels (see [[#Can I Use It?]]) In addition, [[OpenVZ]] documentation exists on the wiki (see [[#Can I Use It?]])
+
 
+
[[Category:QA]]
+

Revision as of 10:47, December 17, 2014

Setting up local git mirror

This tutorial explains how to save bandwidth when several local computers need to pull updates from a single remote git repository.

Use case

This tutorial will be about hosting a local mirror of funtoo git based portage tree.

Following terms should be adapted

Terms Definition
git.lan The git-daemon local mirror host
localhost Any local host
nobody Owner user of .git files
/home/git-mirrors Base path of git-daemon

Local mirror

Prepare directories and get portage tree

# mkdir /home/git-mirrors
# chown nobody /home/git-mirrors
# su -s /bin/sh nobody
$ cd /home/git-mirrors
$ git clone --mirror --bare git://github.com/funtoo/ports-2012.git portage.git

For a security reason we use a nobody user .

git-daemon configuration

/etc/conf.d/git-daemon
GITDAEMON_OPTS="--syslog --verbose --enable=receive-pack --export-all"
GITDAEMON_OPTS="${GITDAEMON_OPTS} --base-path=/home/git-mirrors /home/git-mirrors --interpolated-path=/home/git-mirrors"
GIT_USER=nobody
GIT_GROUP=nobody

Service configuration

To start daemon with a mirror machine boot add git-daemon to default runlevel

# rc-update add git-daemon default

To make changes start immediately just run rc

# rc

Pull from remote

Add the following to /etc/cron.daily/funtoo-sync.sh:

#!/bin/sh
cd /home/git-mirrors/portage.git
su nobody -s "/bin/sh" -c "git fetch"

Cloning from local git-daemon

Local clone from git.lan:

# mv /usr/portage /usr/portage.old
# git clone git://git.lan/portage.git /usr/portage
# cd /usr/portage
# git checkout funtoo.org

Downstream Clients Settings

/etc/portage/make.conf: define client sync source for emerge --sync
SYNC="git://git.lan/portage.git"