Skip to content

Commit

Permalink
2.102.0 Doc Updates (microsoft#287)
Browse files Browse the repository at this point in the history
* 2.102.0 docs

* 2.102.0 role changes

* 2.102.0 status update

* remove dupe message

* start links

* troubleshooting md

* typo

* troubleshooting content - didn't save

* tweak

* system.debug note

* fiddler docs
  • Loading branch information
bryanmacfarlane authored Jun 14, 2016
1 parent b8fff64 commit 902a7c4
Show file tree
Hide file tree
Showing 11 changed files with 132 additions and 53 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,25 @@ Supported on Windows, OSX, Ubuntu and Red Hat. Written for the .NET Core CLR as

## Status

A preview is available for Ubuntu, RedHat and OSX for VSTS. The current preview is more feature complete than the node agent bringing Auto Update, Cancellation, Run as a svc on OSX and Linux, and Gated support.
The preview is feature complete on all platforms and supported for production use.

What's missing from the preview? Windows tf.exe support is finishing up.
The current preview is more feature complete than the node agent bringing Auto Update, Cancellation, Run as a svc on OSX and Linux, and Gated support.

| | Build & Test | Preview | Release |
|---|:-----:|:-----:|:-----:|
|![Apple](docs/res/apple_med.png) **OSX**|![Build & Test](https://mseng.visualstudio.com/_apis/public/build/definitions/b924d696-3eae-4116-8443-9a18392d8544/3080/badge?branch=master)| [Preview 6 v2.101.1](https://github.com/Microsoft/vsts-agent/releases/tag/v2.101.1) | June |
|![Ubuntu](docs/res/ubuntu_med.png) **Ubuntu**|![Build & Test](https://mseng.visualstudio.com/_apis/public/build/definitions/b924d696-3eae-4116-8443-9a18392d8544/2853/badge?branch=master)| [Preview 6 v2.101.1](https://github.com/Microsoft/vsts-agent/releases/tag/v2.101.1) | June |
|![RedHat](docs/res/redhat_med.png) **RedHat**|![Build & Test](https://mseng.visualstudio.com/_apis/public/build/definitions/b924d696-3eae-4116-8443-9a18392d8544/3418/badge?branch=master)| [Preview 6 v2.101.1](https://github.com/Microsoft/vsts-agent/releases/tag/v2.101.1) | June |
|![Win](docs/res/win_med.png) **Windows**|![Build & Test](https://mseng.visualstudio.com/_apis/public/build/definitions/b924d696-3eae-4116-8443-9a18392d8544/2850/badge?branch=master)| [Preview 3 v2.101.1](https://github.com/Microsoft/vsts-agent/releases/tag/v2.101.1) | |
|![Apple](docs/res/apple_med.png) **OSX**|![Build & Test](https://mseng.visualstudio.com/_apis/public/build/definitions/b924d696-3eae-4116-8443-9a18392d8544/3080/badge?branch=master)| [RC v2.102.0](https://github.com/Microsoft/vsts-agent/releases/tag/v2.102.0) | Next Drop |
|![Ubuntu](docs/res/ubuntu_med.png) **Ubuntu**|![Build & Test](https://mseng.visualstudio.com/_apis/public/build/definitions/b924d696-3eae-4116-8443-9a18392d8544/2853/badge?branch=master)| [RC v2.102.0](https://github.com/Microsoft/vsts-agent/releases/tag/v2.102.0) | Next Drop |
|![RedHat](docs/res/redhat_med.png) **RedHat**|![Build & Test](https://mseng.visualstudio.com/_apis/public/build/definitions/b924d696-3eae-4116-8443-9a18392d8544/3418/badge?branch=master)| [RC v2.102.0](https://github.com/Microsoft/vsts-agent/releases/tag/v2.102.0) | Next Drop |
|![Win](docs/res/win_med.png) **Windows**|![Build & Test](https://mseng.visualstudio.com/_apis/public/build/definitions/b924d696-3eae-4116-8443-9a18392d8544/2850/badge?branch=master)| [Preview 4 v2.102.0](https://github.com/Microsoft/vsts-agent/releases/tag/v2.102.0) | July |

## Preview Support

This is the current state of what works with the preview.

This agent can be used for the VSTS service and it replaces the node agent for TFS2015 On-Prem.

| Scenario | OSX/Unix | Windows | Comment |
|:-------------:|:-----:|:-----:|:-----:|
| VSTS Git | Yes | Yes |
| VSTS TfsVC | Yes | Soon |
| VSTS TfsVC | Yes | Yes |
| TFS2015 Git | Yes | No | Win use agent with 2015 |
| TFS2015 TfsVC | Yes | No | Win use agent with 2015 |

Expand All @@ -49,6 +47,10 @@ This agent can be used for the VSTS service and it replaces the node agent for T

![redhat](docs/res/redhat_sm.png) [Start RedHat](docs/start/startredhat.md)

## Troubleshooting

Troubleshooting tips are [located here](docs/troubleshooting.md)

## Contribute

For developers that want to contribute, [read here](docs/contribute.md) on how to build and test.
3 changes: 0 additions & 3 deletions docs/config.md

This file was deleted.

2 changes: 2 additions & 0 deletions docs/start/moreconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Successfully added the agent

# Unconfigure

> Important: If you're running as a service on Linux/OSX, ensure you `stop` then `uninstall` the service before unconfiguring. See [Nix Service Config](nixsvc.md)
```bash
$ ./config.sh remove
Removing service
Expand Down
50 changes: 31 additions & 19 deletions docs/start/nixsvc.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
# Running As A Service On Unix and OSX

## Configuration
Key Points:
- This is a convenience which only creates OS specific service files.
- SystemD is used on Linux. Ubuntu 16 LTS, Redhat 7.1 has SystemD
- SystemD requires sudo so all scripts below must be called with sudo. OSX does not.

**During configuration, answer Y to run as a service**.
## Install

The systemd and launchagent files run ./runsvc.sh which will set PATH to that if it's present.
Install will create a LaunchAgent plist on OSX or a systemd unit file on Linux

You can also inject anything you want to run when the service runs. For example setting up environment, calling other scripts etc...

./runsvc.sh
```
# insert anything to setup env when running as a service
```bash
$ ./svc.sh install
...
Creating runsvc.sh
Creating .Service
svc install complete
```

Service files point to `./runsvc.sh` which will setup the environment and start the agents host. See Environment section below.

Start and stop the service after making changes

## Managing the Service
Expand Down Expand Up @@ -74,7 +80,7 @@ On OSX the convenience default is to create the service as a LaunchAgent. A Lau

When you install and/or configure tools, your path is often setup or other environment variables are set. Examples are PATH, JAVA_HOME, ANT_HOME, MYSQL_PATH etc...

If your environment changes at any time, you can run env.sh and it will update your path. You can also manually edit .Env file. Changes are retained.
If your environment changes at any time, you can run env.sh and it will update your path. You can also manually edit .env file. Changes are retained.

Stop and start the service for changes to take effect.

Expand All @@ -90,23 +96,34 @@ Started:
15397 0 vsts.agent.bryanmac.testsvc2
```

## Environment

Configuring as a service will snapshot off your PATH and other "interesting variables" like LANG, JAVA_HOME etc.. When the service starts, it will read these and set. This allows for unified environment management between

```bash
$ ls -la
-rwxrwx--- 1 bryanmac staff 189 May 29 11:42 .Agent
-rwxrwx--- 1 bryanmac staff 106 May 29 11:41 .Credentials
-rw-r--r-- 1 bryanmac staff 58 May 29 11:44 .Env
-rw-r--r-- 1 bryanmac staff 187 May 29 11:40 .Path
-rwxrwx--- 1 bryanmac staff 189 May 29 11:42 .agent
-rwxrwx--- 1 bryanmac staff 106 May 29 11:41 .credentials
-rw-r--r-- 1 bryanmac staff 58 May 29 11:44 .env
-rw-r--r-- 1 bryanmac staff 187 May 29 11:40 .path
...
-rwxr-xr-x 1 bryanmac staff 546 May 29 11:40 env.sh
```

Run ./env.sh to update.

You can also inject anything you want to run when the service runs. For example setting up environment, calling other scripts etc...

./runsvc.sh
```
# insert anything to setup env when running as a service
```

## Service Files

This is a convenience that simply creates a service file for you can sets permissions. You are free to manually configure and control your service using alternate methods.

Details are in .Service file in root of the agent
Details are in .service file in root of the agent

OSX LaunchAgent: ~/Library/LaunchAgents/vsts.agent.{accountName}.{agentName}.plist
Linux SystemD: /etc/systemd/system/vsts.agent.{accountName}.{agentName}.service
Expand All @@ -118,8 +135,3 @@ Linux: ./bin/vsts.agent.service.template

For example, on OSX you could use that template to run as a launch daemon if you are not needing UI tests and/or don't want to configure auto logon lock. [Details Here](https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html)






15 changes: 9 additions & 6 deletions docs/start/roles.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# Configure Account and Roles

VSTS only for now. On-prem coming with NTLM support in the works.
## VSTS

Create a PAT token. [Step by Step here](http://roadtoalm.com/2015/07/22/using-personal-access-tokens-to-access-visual-studio-online/)

Add the user you created the PAT token for to *both*:
## On Premises TFS

1. Agent Pool Administrators (allows to register)
2. Agent Pool Service Accounts (allows listening to build queue)
You can use a domain user but it's recommended to create a local windows user on each of your application tiers specifically for registering build agents.

## Add to Role

Add the user from above to only the Agent Pool Administrators which allows you to register the agent.

![Agent Roles](roles.png "Agent Roles")

>> TIPS:
>> You can add to roles for a specific pool or select "All Pools" on the left and grant for all pools. This allows the account owner to delegate build administration globally or for specific pools. [More here](https://msdn.microsoft.com/en-us/Library/vs/alm/Build/agents/admin)
>> The PAT token is only used to listen to the message queue for a build job
>> When a build is run, it will generate an OAuth token for the scoped identity selected on the general tab of the build definition. That token is short lived and will be used to access resource in VSTS
>> The role is only needed to register the agent. A token is downloaded to listen to the queue.
>> When a build is run, it will generate an OAuth token for the scoped identity selected on the general tab of the build definition. That token is short lived and will be used to access resource in VSTS. The account used to register the agent has no bearing on the build run time credentials
Binary file modified docs/start/roles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 2 additions & 4 deletions docs/start/startosx.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

## Step 2: Download from Releases

Download the agent from [github releases](https://github.com/Microsoft/vsts-agent/releases/tag/v2.101.1)
Download the agent from [github releases](https://github.com/Microsoft/vsts-agent/releases/tag/v2.102.0)

## Step 3: Create the agent

```bash
~/$ mkdir myagent && cd myagent
~/myagent$ tar xzf ~/Downloads/vsts-agent-osx.10.11-x64-2.101.1.tar.gz
~/myagent$ tar xzf ~/Downloads/vsts-agent-osx.10.11-x64-2.102.0.tar.gz
```
## Step 4: Configure

Expand All @@ -29,8 +29,6 @@ Download the agent from [github releases](https://github.com/Microsoft/vsts-agen
## Step 5: Optionally run the agent interactively

If you didn't run as a service above:

```bash
~/myagent$ ./run.sh
```
Expand Down
6 changes: 2 additions & 4 deletions docs/start/startredhat.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

## Step 2: Download from Releases

Download the agent from [github releases](https://github.com/Microsoft/vsts-agent/releases/tag/v2.101.1)
Download the agent from [github releases](https://github.com/Microsoft/vsts-agent/releases/tag/v2.102.0)

## Step 3: Create the agent

```bash
~/$ mkdir myagent && cd myagent
~/myagent$ tar xzf ~/Downloads/vsts-agent-rhel.7.2-x64-2.101.1.tar.gz
~/myagent$ tar xzf ~/Downloads/vsts-agent-rhel.7.2-x64-2.102.0.tar.gz
```
## Step 4: Configure

Expand All @@ -29,8 +29,6 @@ Download the agent from [github releases](https://github.com/Microsoft/vsts-agen
## Step 5: Optionally run the agent interactively

If you didn't run as a service above:

```bash
~/myagent$ ./run.sh
```
Expand Down
6 changes: 2 additions & 4 deletions docs/start/startubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

## Step 2: Download from Releases

Download the agent from [github releases](https://github.com/Microsoft/vsts-agent/releases/tag/v2.101.1)
Download the agent from [github releases](https://github.com/Microsoft/vsts-agent/releases/tag/v2.102.0)

## Step 3: Create the agent

```bash
~/$ mkdir myagent && cd myagent
~/myagent$ tar xzf ~/Downloads/vsts-agent-ubuntu.14.04-x64-2.101.1.tar.gz
~/myagent$ tar xzf ~/Downloads/vsts-agent-ubuntu.14.04-x64-2.102.0.tar.gz
```
## Step 4: Configure

Expand All @@ -31,8 +31,6 @@ Download the agent from [github releases](https://github.com/Microsoft/vsts-agen
## Step 5: Optionally run the agent interactively

If you didn't run as a service above:

```bash
~/myagent$ ./run.sh
```
Expand Down
6 changes: 2 additions & 4 deletions docs/start/startwin.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# ![win](../res/win_med.png) Windows Agent

> NOTE: Preview 1 only has git support. TFSVC support is in progress for the next preview.
## Step 1: System Requirements

[Read here](../preview/latebreaking.md) to ensure system packages are installed

## Step 2: Download from Releases

Download the agent from [github releases](https://github.com/Microsoft/vsts-agent/releases/tag/v2.101.1)
Download the agent from [github releases](https://github.com/Microsoft/vsts-agent/releases/tag/v2.102.0)

## Step 3: Create the agent

```bash
c:\ mkdir myagent && cd myagent
C:\myagent> Add-Type -AssemblyName System.IO.Compression.FileSystem ; [System.IO.Compression.ZipFile]::ExtractToDirectory("$HOME\Downloads\vsts-agent-win7-x64-2.101.1.zip", "$PWD")
C:\myagent> Add-Type -AssemblyName System.IO.Compression.FileSystem ; [System.IO.Compression.ZipFile]::ExtractToDirectory("$HOME\Downloads\vsts-agent-win7-x64-2.102.0.zip", "$PWD")
```
## Step 4: Configure

Expand Down
71 changes: 71 additions & 0 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Troubleshooting

The agent sends logs to the server but some failures such as configuration, networking or permissions prevent that. It requires investigating within the agent.

Often these logs are most relevant to the product but they can sometimes provide hints to a user as what could be wrong.

## System.Debug

If you are having issues with a build, the first step is to set System.Debug to true on the build definitions variables tab. The agent and tasks will emit [debug]xxx lines for more detailed insight into what the specific task is doing.

## Agent Trace Logs

Logs are in the _diag folder.

The agent has two parts. The agent which listens to the build queue. When it gets a build message, it creates a worker process to run that build.

For example:
```bash
$ ls -la _diag/
-rwxr--r-- 1 bryanmac staff 23126 Jun 11 06:43 Agent_20160611-104223-utc.log
-rwxr--r-- 1 bryanmac staff 26046 Jun 11 08:39 Agent_20160611-123755-utc.log
-rwxr--r-- 1 bryanmac staff 240035 Jun 11 08:38 Worker_20160611-123825-utc.log
-rwxr--r-- 1 bryanmac staff 220196 Jun 11 08:38 Worker_20160611-123843-utc.log
-rwxr--r-- 1 bryanmac staff 220012 Jun 11 08:39 Worker_20160611-123858-utc.log
```

If the agent isn't picking up builds, the agent logs are likely the most relevant. If a build starts running and you want to get details of that build, the specific worker log is relevant.

Secrets are masked out of the logs.

## Http Tracing Windows

Start [Fiddler](http://www.telerik.com/fiddler).
It's recommended to only listen to agent traffic. File, Capture Traffic off (F12)

Let the agent know to use the proxy:

```bash
set VSTS_HTTP_PROXY=https://127.0.0.1:8888
```

Run the agent interactively. If you're running as a service, you can set as the environment variable in control panel for the account the service is running as.

Restart the agent.

TODO: video

## Http Tracing OSX / Linux

It's easy to capture the http trace of the agent using Charles Proxy (similar to Fiddler on windows).

TODO: video

Start Charles Proxy
Charles: Proxy > Proxy Settings > SSL Tab. Enable. Add URL
Charles: Proxy > Mac OSX Proxy. Recommend disabling to only see agent traffic.

```bash
export VSTS_HTTP_PROXY=https://127.0.0.1:8888
```

Run the agent interactively. If it's running as a service, you can set in the .env file. See [nix service](start/nixsvc.md)

Restart the agent.

## Security Notice

HTTP traces and trace files can contain credentials.

1. Do not POST them on a publically accessible site.
2. If you send them to the product team, they will be treated securely and discarded after the investigation.

0 comments on commit 902a7c4

Please sign in to comment.