brazil Flashcards

1
Q

What is the Brazil Build System and why it exist?

A

The Brazil Build System is a set of source repositories, a set of policies, and a set of build and deployment tools. It exists to manage the complexity of Amazon’s ever-growing codebase.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a brazil packages?

A

A Brazil Package is the smallest buildable/deployable unit. Packages are structured as code with similar function and should be built and deployed together, and is often a library that performs some function or an application that is actually run. A package may have multiple Major Versions and multiple Branches, and declares its external dependencies in the Brazil Config file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What to do after you change your code ?

A

Once you’ve made some changes, you need to “build” the artifacts of your package. This is done through the Brazil CLI, which includes a brazil-build command. This command looks at your package, finds the build tool you’ve defined in your Config file, and executes it. This produces a set of build artifacts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How is the package release to live?

A

Once your modifications are complete, tested, and ready to be released, the package is submitted into Package Builder through the Builder website or the Brazil CLI, where it can be released into live. The Package Builder will re-run your build in a completely sandboxed environment and produce an authoritative set of artifacts which are deterministically related to the commit you chose to build. It is these artifacts which are then released into the version set. Once complete, the changes made in the package can now be used by others.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a dependecy in brazil?

A

In Brazil, a dependency is a package that provides functionality that your package requires to be compiled, tested, or run.

A package may have zero or more dependencies. Each dependency may in turn have zero or more dependencies of their own, and so on. Dependencies explicitly declared by your package are referred to as direct dependencies, and their dependencies are transitive dependencies.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are restrictions of the brazil dependecy

A

Dependency cycles are prohibited – a package cannot depend on itself or any of its own direct or indirect consumers. Thus a package and its dependencies form a directed acyclic graph.

When you declare a dependency on a package, you must select a distinct major version of that package. If the major version that you select conflicts with the major version(s) selected by one or more of your direct or transitive dependencies, you will need to resolve the major version conflict.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Are dependecy transitive in brazil ?

A

NO
When you declare a dependency on another package, not all of its dependencies are visible to your package. This is due to the fact that not all dependency types in Brazil are transitive.

As a best practice, you should always declare a direct dependency on any package that your package makes direct code references to, even if one of your existing direct dependencies causes that package to be a transitive dependency of your package.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are different type of dependency you can put in your Config?

A

Dependency Type Config Key Transitive? Description
Library (aka Normal) dependencies yes Your package’s source code makes direct references to code contained in these packages.
Test test-dependencies no Your package’s test code makes direct references to code contained in these packages.
Build Tool build-tools no Your package’s build logic requires these packages to provide code-generation, compilation, or other build-time functionality.
Runtime runtime-dependencies yes Your package doesn’t need these packages at compile time, but they are needed at runtime.
Resolves Conflict resolves-conflict-dependencies yes Pseudo-dependency used only to resolve a major version conflict. Does not affect build-tool handling!
Remove Dependency remove-dependencies yes Pseudo-dependency used only to remove transitive dependencies. Ignored if the dependency to be removed is not found in the dependency graph of this package. Does not affect build-tool handling!
Synonym synonym-for yes Brazil substitutes the synonym-for target for all appearances of this package.
Rebuild rebuild-when-dependency-changes no Causes the declaring package to be rebuilt in PackageBuilder whenever the depended-on package is rebuilt.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the tool to debug dependencies errors?

A
1 GordianKnot
2 brazil-graph
3 brazil-path
4 Brazil CLI
5 Brazil Version Set Directory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is GordianKnot?

A

GordianKnot is a set of command-line tools to simplify and automate the management of Brazil dependencies.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is brazil graph ?

A

brazil-graph can build graphical views of your dependencies.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a version set?

A

A version set is a data structure that contains all of a package’s dependencies and their versions.

Your software project will often need to use software written by other people. These dependencies can be libraries, build tools, or other programs (in Brazil, all these different types of dependencies are packages). Your software’s dependencies often also have their own dependencies. Additionally, you must track and control the versions of your dependencies in order to prevent introducing unexpected changes (this is really important).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

how do you list packages in the version set?

A

brazil vs print -vs live | more

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

how do you get the history log of a version set?

A

brazil vs history -vs Fubar/test1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you add a package to the version set?

A
# Add a package from the tracking version set:
brazil vs merge --destination VersionSet/mainline --addNewPackage PackageName1-1.0 --addNewPackage OtherPackage-2.x
# Make sure to sync your workspace after the merge is done (see url printed by 'brazil vs merge')
brazil ws sync --md
# Build 
brazil-build
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

how do you remove a packge from the version set?

A

brazil vs removemajorversions –vs –mv

17
Q

What is a package version ?

A

A package version uniquely identifies a per-platform set of builds of a specific major version of a package at a specific source revision, against a specific set of dependency package versions.

18
Q

How do you create a new package version?

A

create new versions by submitting build requests to PackageBuilder. You can also get a specific set of package versions into your version set by doing a merge into or an update of your version set.

19
Q

What is a build request?

A

A build request is a request to “officially” build one or more Brazil packages on Brazil’s dedicated build hardware and release the built package versions into a version set. Build requests can be created using build.amazon.comVIPSER or the Brazil CLI and are carried out by the Package Builder system.

20
Q

What are the main directives in the Config file?

A
interfaces
scope 
deploy
dependencies
build-environment
build-system 
targets
21
Q

What is the directive dependencies in the config?

A

dependencies, runtime-dependencies, test-dependencies, and build-tools let you declare what other packages your package depends on, in different roles. See BrazilBuildSystem/Concepts/Dependencies for details. Before adding dependencies to the Config file, make sure that the dependency packages are already merged into the version set which you are using.

22
Q

What is the directive build-environment

in the config?

A

The build-environment exists to let early adopters change the way the build systems handle their package. Most recently, it was used to configure the Sandboxed Build environment in some scenarios, mostly to tweak the network-access property per these options to a value other than the default blocked.

23
Q

What is the directive build-system

in the config?

A

The build-system directive specifies the executable used to build the package, which is provided by one of your build-tools dependencies. See BrazilBuildSystem/Reference/ConfigFile/BuildSystem and the documentation for your particular build-system for details. For legacy reasons, if omitted, braziltools will be used on the build fleet only, and your builds will fail on your desktop. New packages should always specify a build-system.

24
Q

What is the directive targets

in the config?

A

Targets specify what artifacts a package produces so that consumers know how the package is meant to be consumed.
In our case we use the setup.py

25
Q

What is the directive deploy

in the config?

A

The deploy directive explains how the package’s artifacts should be prepared for deployment.

we use
deploy = {
generic = true;
};