Skip to content

Commit

Permalink
use more recent corefx library and .Net Core CLI (#216)
Browse files Browse the repository at this point in the history
* use latest corefx libs

* update docs to install new .Net core CLI 1.0.0-preview2-002875

* fix dev.sh script to allow running agent executable files with sudo on linux
  • Loading branch information
Stan Iliev committed May 31, 2016
1 parent de10b44 commit 85abb34
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 87 deletions.
34 changes: 12 additions & 22 deletions docs/dev/netcore.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,53 @@

Building and packaging the agent, MUST be done with a specific version of the toolchain and .NET Core. They are changing rapidly and our build process assumes this version. We are looking into the env pulling that version.

To build, we rely on .NET Core SDK version 1.0.0-rc2-002416
To build, we rely on .NET Core SDK version 1.0.0-preview2-002875

Additional instructions are available [here](https://dotnet.github.io/getting-started/) Please use the links below to download the correct version of Windows/OSX installers.
Additional instructions are available [here](https://www.microsoft.com/net/core#windows) Please use the links below to download the correct version of Windows/OSX SDK files.


## ![Win](../win_med.png) Windows

Install [dotnet-dev-win-x64.1.0.0-rc2-002416.exe](https://dotnetcli.blob.core.windows.net/dotnet/beta/Installers/1.0.0-rc2-002416/dotnet-dev-win-x64.1.0.0-rc2-002416.exe)
Download the archive, extract and add the new folder to the PATH [dotnet-dev-win-x64.1.0.0-preview2-002875.zip](https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/1.0.0-preview2-002875/dotnet-dev-win-x64.1.0.0-preview2-002875.zip)

> <sub><sup>TIP: Uninstall any existing version first (Programs and Features -> Microsoft Dotnet CLI for Windows).</sup></sub>
## ![Apple](../apple_med.png) OSX 10.11

Install [dotnet-dev-osx-x64.1.0.0-rc2-002416.pkg](https://dotnetcli.blob.core.windows.net/dotnet/beta/Installers/1.0.0-rc2-002416/dotnet-dev-osx-x64.1.0.0-rc2-002416.pkg)
Download the archive, extract and add the new folder to the PATH [dotnet-dev-osx-x64.1.0.0-preview2-002875.tar.gz](https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/1.0.0-preview2-002875/dotnet-dev-osx-x64.1.0.0-preview2-002875.tar.gz)

> <sub><sup>TIP: Uninstall any existing version first by deleting the folder that contains "dotnet" command.</sup></sub>

## ![Linux](../linux_med.png) Ubuntu 14.04

On Ubuntu, it must be installed using dpkg
The script below downloads and extracts .Net Core in a folder ~/dotnet. Please add this folder to your PATH.

```bash
mkdir ~/dotnetpackages

wget -P ~/dotnetpackages https://dotnetcli.blob.core.windows.net/dotnet/beta/Installers/1.0.0-rc2-002416/dotnet-host-ubuntu-x64.1.0.0-rc2-002416.deb

wget -P ~/dotnetpackages https://dotnetcli.blob.core.windows.net/dotnet/beta/Installers/1.0.0-rc2-3002416/dotnet-sharedframework-ubuntu-x64.1.0.0-rc2-3002416.deb

wget -P ~/dotnetpackages https://dotnetcli.blob.core.windows.net/dotnet/beta/Installers/1.0.0-rc2-002416/dotnet-sdk-ubuntu-x64.1.0.0-rc2-002416.deb
mkdir ~/dotnet

sudo dpkg -i ~/dotnetpackages/dotnet-host-ubuntu-x64.1.0.0-rc2-002416.deb
cd ~/dotnet

sudo dpkg -i ~/dotnetpackages/dotnet-sharedframework-ubuntu-x64.1.0.0-rc2-3002416.deb
wget https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/1.0.0-preview2-002875/dotnet-dev-ubuntu-x64.1.0.0-preview2-002875.tar.gz

sudo dpkg -i ~/dotnetpackages/dotnet-sdk-ubuntu-x64.1.0.0-rc2-002416.deb
tar zxfv dotnet-dev-ubuntu-x64.1.0.0-preview2-002875.tar.gz
```

> <sub><sup>TIP: Uninstall any existing version first by listing existing packages containing "dotnet" in the name with "dpkg --get-selections | grep dotnet" and then uninstall one by one with "sudo apt-get purge dotnet_package_name".</sup></sub>
## ![Redhat](../redhat.png) Red Hat Enterprise Linux 7.2

The script below downloads and extracts .Net Core in a folder ~/dotnet. Please add this folder to your PATH (usually by editing ~/.bash_profile). We install several yum packages needed by .Net Core and our dev.sh script. The libcurl that is installed by default on redhat 7.2 contains a bug, which may fail git cloning during a vsts-agent build. We install a new yum repository with a more recent libcurl.
The script below downloads and extracts .Net Core in a folder ~/dotnet. Please add this folder to your PATH (usually by editing ~/.bash_profile). We install several yum packages needed by .Net Core and our dev.sh script.

```bash
mkdir ~/dotnet

cd ~/dotnet

wget https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/1.0.0-rc2-002416/dotnet-dev-rhel-x64.1.0.0-rc2-002416.tar.gz
wget https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/1.0.0-preview2-002875/dotnet-dev-rhel-x64.1.0.0-preview2-002875.tar.gz

tar zxfv dotnet-dev-rhel-x64.1.0.0-rc2-002416.tar.gz
tar zxfv dotnet-dev-rhel-x64.1.0.0-preview2-002875.tar.gz

sudo yum -y install libunwind.x86_64 icu git curl zip unzip

sudo rpm -Uvh http://www.city-fan.org/ftp/contrib/yum-repo/rhel6/x86_64/city-fan.org-release-1-13.rhel6.noarch.rpm

sudo yum -y install libcurl
```

28 changes: 14 additions & 14 deletions src/Agent.Listener/_project.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "1.0.0-*",
"compilationOptions": {
"buildOptions": {
"emitEntryPoint": true,
"warningsAsErrors": true
},
Expand All @@ -11,7 +11,7 @@

"configurations": {
"Debug": {
"compilationOptions": {
"buildOptions": {
"define": [
"DEBUG",
"TRACE",
Expand All @@ -20,7 +20,7 @@
}
},
"Release": {
"compilationOptions": {
"buildOptions": {
"define": [
"TRACE",
"OS_WINDOWS"
Expand All @@ -31,23 +31,23 @@
},

"dependencies": {
"NETStandard.Library": "1.5.0-rc3-24011-00",
"Microsoft.NETCore.App": "1.0.0-rc3-004306",
"Microsoft.VisualStudio.Services.Agent": { "target": "project", "version": "1.0.0-*" },
"Microsoft.Win32.Registry": "4.0.0-rc3-24011-00",
"Microsoft.Win32.Registry": "4.0.0-rc3-24125-01",
"vss-api-netcore": "0.5.10-private",
"System.ServiceProcess.ServiceController": "4.1.0-rc3-24011-00",
"System.IO.Compression.ZipFile": "4.0.1-rc3-24011-00",
"System.IO.FileSystem.AccessControl": "4.0.0-rc3-24011-00",
"System.ServiceProcess.ServiceController": "4.1.0-rc3-24125-01",
"System.IO.Compression.ZipFile": "4.0.1-rc3-24125-01",
"System.IO.FileSystem.AccessControl": "4.0.0-rc3-24125-01",
"Newtonsoft.Json": "7.0.1",
"System.Diagnostics.TraceSource": "4.0.0-rc3-24011-00",
"System.Security.AccessControl": "4.0.0-rc3-24011-00",
"System.Runtime.InteropServices": "4.1.0-rc3-24011-00",
"System.Security.Cryptography.Cng": "4.1.0-rc3-24011-00"
"System.Diagnostics.TraceSource": "4.0.0-rc3-24125-01",
"System.Security.AccessControl": "4.0.0-rc3-24125-01",
"System.Runtime.InteropServices": "4.1.0-rc3-24125-01",
"System.Security.Cryptography.Cng": "4.2.0-rc3-24125-01"
},

"frameworks": {
"dnxcore50": {
"imports": "portable-net451+win8"
"netcoreapp1.0": {
"imports": ["dnxcore50", "portable-net451+win8"]
}
},

Expand Down
32 changes: 16 additions & 16 deletions src/Agent.Worker/_project.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "1.0.0-*",
"compilationOptions": {
"buildOptions": {
"emitEntryPoint": true,
"warningsAsErrors": true
},
Expand All @@ -11,7 +11,7 @@

"configurations": {
"Debug": {
"compilationOptions": {
"buildOptions": {
"define": [
"DEBUG",
"TRACE",
Expand All @@ -20,7 +20,7 @@
}
},
"Release": {
"compilationOptions": {
"buildOptions": {
"define": [
"TRACE",
"OS_WINDOWS"
Expand All @@ -31,24 +31,24 @@
},

"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc3-004306",
"Microsoft.VisualStudio.Services.Agent": { "target": "project", "version": "1.0.0-*" },
"vss-api-netcore": "0.5.10-private",
"System.Diagnostics.TraceSource": "4.0.0-rc3-24011-00",
"System.Xml.XmlSerializer": "4.0.11-rc3-24011-00",
"System.Security.Cryptography.Algorithms": "4.1.0-rc3-24011-00",
"System.IO.Compression.ZipFile": "4.0.1-rc3-24011-00",
"System.Linq": "4.1.0-rc3-24011-00",
"System.Security.Cryptography.Primitives" : "4.0.0-rc3-24011-00",
"System.Security.Cryptography.ProtectedData": "4.0.0-rc3-24011-00",
"NETStandard.Library": "1.5.0-rc3-24011-00",
"System.Xml.XPath.XmlDocument": "4.0.1-rc3-24011-00",
"System.Threading.Tasks.Parallel": "4.0.1-rc3-24011-00",
"System.Collections.NonGeneric": "4.0.1-rc3-24011-00"
"System.Diagnostics.TraceSource": "4.0.0-rc3-24125-01",
"System.Xml.XmlSerializer": "4.0.11-rc3-24125-01",
"System.Security.Cryptography.Algorithms": "4.2.0-rc3-24125-01",
"System.IO.Compression.ZipFile": "4.0.1-rc3-24125-01",
"System.Linq": "4.1.0-rc3-24125-01",
"System.Security.Cryptography.Primitives" : "4.0.0-rc3-24125-01",
"System.Security.Cryptography.ProtectedData": "4.0.0-rc3-24125-01",
"System.Xml.XPath.XmlDocument": "4.0.1-rc3-24125-01",
"System.Threading.Tasks.Parallel": "4.0.1-rc3-24125-01",
"System.Collections.NonGeneric": "4.0.1-rc3-24125-01"
},

"frameworks": {
"dnxcore50": {
"imports": "portable-net451+win8"
"netcoreapp1.0": {
"imports": ["dnxcore50", "portable-net451+win8"]
}
},

Expand Down
36 changes: 18 additions & 18 deletions src/Microsoft.VisualStudio.Services.Agent/_project.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"version": "1.0.0-*",
"compilationOptions": {
"buildOptions": {
"emitEntryPoint": false,
"warningsAsErrors": true
},

"configurations": {
"Debug": {
"compilationOptions": {
"buildOptions": {
"define": [
"DEBUG",
"TRACE",
Expand All @@ -16,7 +16,7 @@
}
},
"Release": {
"compilationOptions": {
"buildOptions": {
"define": [
"TRACE",
"OS_WINDOWS"
Expand All @@ -27,26 +27,26 @@
},

"dependencies": {
"NETStandard.Library": "1.5.0-rc3-24125-01",
"vss-api-netcore": "0.5.10-private",
"Microsoft.Win32.Registry": "4.0.0-rc3-24011-00",
"Microsoft.Win32.Registry": "4.0.0-rc3-24125-01",
"Newtonsoft.Json": "7.0.1",
"System.Diagnostics.TraceSource": "4.0.0-rc3-24011-00",
"System.Diagnostics.TextWriterTraceListener": "4.0.0-rc3-24011-00",
"System.Diagnostics.Process": "4.1.0-rc3-24011-00",
"System.IO": "4.1.0-rc3-24011-00",
"System.IO.Pipes": "4.0.0-rc3-24011-00",
"System.Linq.Parallel": "4.0.1-rc3-24011-00",
"System.Runtime": "4.1.0-rc3-24011-00",
"System.Runtime.Serialization.Primitives": "4.1.1-rc3-24011-00",
"System.Xml.XmlSerializer": "4.0.11-rc3-24011-00",
"System.Dynamic.Runtime": "4.0.11-rc3-24011-00",
"System.Net.Http": "4.0.1-rc3-24011-00",
"NETStandard.Library": "1.5.0-rc3-24011-00"
"System.Diagnostics.TraceSource": "4.0.0-rc3-24125-01",
"System.Diagnostics.TextWriterTraceListener": "4.0.0-rc3-24125-01",
"System.Diagnostics.Process": "4.1.0-rc3-24125-01",
"System.IO": "4.1.0-rc3-24125-01",
"System.IO.Pipes": "4.0.0-rc3-24125-01",
"System.Linq.Parallel": "4.0.1-rc3-24125-01",
"System.Runtime": "4.1.0-rc3-24125-01",
"System.Runtime.Serialization.Primitives": "4.1.1-rc3-24125-01",
"System.Xml.XmlSerializer": "4.0.11-rc3-24125-01",
"System.Dynamic.Runtime": "4.0.11-rc3-24125-01",
"System.Net.Http": "4.1.0-rc3-24125-01"
},

"frameworks": {
"dnxcore50": {
"imports": "portable-net451+win8"
"netcoreapp1.0": {
"imports": ["dnxcore50", "portable-net451+win8"]
}
},

Expand Down
20 changes: 10 additions & 10 deletions src/Test/_project.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"version": "1.0.0-*",
"compilationOptions": {
"buildOptions": {
"emitEntryPoint": true,
"warningsAsErrors": true
},

"configurations": {
"Debug": {
"compilationOptions": {
"buildOptions": {
"define": [
"DEBUG",
"TRACE",
Expand All @@ -16,7 +16,7 @@
}
},
"Release": {
"compilationOptions": {
"buildOptions": {
"define": [
"TRACE",
"OS_WINDOWS"
Expand All @@ -27,11 +27,11 @@
},

"dependencies": {
"NETStandard.Library": "1.5.0-rc3-24011-00",
"Microsoft.NETCore.TestHost": "1.0.0-rc3-24011-00",
"System.Buffers": "4.0.0-rc3-24011-00",
"System.Reflection.TypeExtensions": "4.1.0-rc3-24011-00",
"System.Threading.ThreadPool": "4.0.10-rc3-24011-00",
"Microsoft.NETCore.App": "1.0.0-rc3-004306",
"Microsoft.NETCore.TestHost": "1.0.0-rc3-24125-01",
"System.Buffers": "4.0.0-rc3-24125-01",
"System.Reflection.TypeExtensions": "4.1.0-rc3-24125-01",
"System.Threading.ThreadPool": "4.0.10-rc3-24125-01",
"moq.netcore": "4.4.0-beta8",
"xunit": "2.1.0",
"xunit.console.netcore": "1.0.2-prerelease-00101",
Expand All @@ -43,8 +43,8 @@
"Agent.Worker": { "target": "project", "version": "1.0.0-*" }
},
"frameworks": {
"dnxcore50": {
"imports": "portable-net451+win8"
"netcoreapp1.0": {
"imports": ["dnxcore50", "portable-net451+win8"]
}
},

Expand Down
20 changes: 13 additions & 7 deletions src/dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ function generateConstant()
rundotnet publish failed build_dirs[0]

# get the runtime we are build for
# if exist Agent.Listener/bin/${BUILD_CONFIG}/dnxcore50
build_folder="Microsoft.VisualStudio.Services.Agent/bin/${BUILD_CONFIG}/dnxcore50"
# if exist Agent.Listener/bin/${BUILD_CONFIG}/netcoreapp1.0
build_folder="Microsoft.VisualStudio.Services.Agent/bin/${BUILD_CONFIG}/netcoreapp1.0"
if [ ! -d "${build_folder}" ]; then
echo "You must build first. Expecting to find ${build_folder}"
fi
Expand Down Expand Up @@ -157,7 +157,7 @@ function publish ()
function copyBin ()
{
echo Copying ${1}
pushd ${1}/bin/${BUILD_CONFIG}/dnxcore50 > /dev/null
pushd ${1}/bin/${BUILD_CONFIG}/netcoreapp1.0 > /dev/null

source_dir=$(ls -d */)publish/
if [ ! -d "$source_dir" ]; then
Expand Down Expand Up @@ -191,6 +191,12 @@ function layout ()

cp -Rf ./Misc/layoutroot/* ${LAYOUT_DIR}
cp -Rf ./Misc/layoutbin/* ${LAYOUT_DIR}/bin

#change execution flag to allow running with sudo
if [[ "$PLATFORM" == 'linux' ]]; then
chmod +x ${LAYOUT_DIR}/bin/Agent.Listener
chmod +x ${LAYOUT_DIR}/bin/Agent.Worker
fi

# clean up files not meant for platform
if [[ ("$PLATFORM_NAME" == "Linux") || ("$PLATFORM_NAME" == "Darwin") ]]; then
Expand Down Expand Up @@ -225,8 +231,8 @@ function runtest ()
{
heading Testing ...
dotnet publish Test || failed "publishing Test"
rm -Rf Test/bin/${BUILD_CONFIG}/dnxcore50/_diag
pushd Test/bin/${BUILD_CONFIG}/dnxcore50 > /dev/null
rm -Rf Test/bin/${BUILD_CONFIG}/netcoreapp1.0/_diag
pushd Test/bin/${BUILD_CONFIG}/netcoreapp1.0 > /dev/null
pushd $(ls -d */ | grep -v '_')publish > /dev/null
./corerun xunit.console.netcore.exe Test.dll -xml testresults.xml || failed "failed tests"
popd > /dev/null
Expand All @@ -251,8 +257,8 @@ function buildtest ()
function package ()
{
# get the runtime we are build for
# if exist Agent.Listener/bin/${BUILD_CONFIG}/dnxcore50
build_folder="Agent.Listener/bin/${BUILD_CONFIG}/dnxcore50"
# if exist Agent.Listener/bin/${BUILD_CONFIG}/netcoreapp1.0
build_folder="Agent.Listener/bin/${BUILD_CONFIG}/netcoreapp1.0"
if [ ! -d "${build_folder}" ]; then
echo "You must build first. Expecting to find ${build_folder}"
fi
Expand Down

0 comments on commit 85abb34

Please sign in to comment.