├── .gitattributes
├── .gitignore
├── .gitmodules
├── BUILD.md
├── INSTALL.md
├── IronFoundry.sln
├── IronFoundry.sln.DotSettings
├── LICENSE.txt
├── README.md
├── build.bat
├── build
├── MSBuildTasks
│ ├── MSBuildTasks.nupkg
│ ├── content
│ │ └── MSBuild.Community.Tasks.ReadMe.md
│ └── tools
│ │ ├── Install.ps1
│ │ ├── MSBuild.Community.Tasks.Targets
│ │ ├── MSBuild.Community.Tasks.dll
│ │ ├── MSBuild.psm1
│ │ └── Uninstall.ps1
├── build-old.bat
├── build.proj
├── build.targets
├── package-restore.targets
└── xunit.runners
│ ├── tools
│ ├── xunit.abstractions.dll
│ ├── xunit.runner.msbuild.dll
│ ├── xunit.runner.utility.dll
│ └── xunit.runner.utility.xml
│ └── xunit.runners.nupkg
├── common
└── IronFoundry.snk
├── docs
├── eject.c
├── licenses
│ ├── ab.exe.txt
│ ├── asprosys.txt
│ ├── galasoft_mvvm.txt
│ ├── newtonsoft_json.txt
│ ├── nlog.txt
│ ├── restsharp.txt
│ ├── sharpziplib.txt
│ ├── structuremap.txt
│ └── wpftoolkit_extended.txt
└── warden-tests.txt
├── images
├── CloudFoundrySmall.ico
├── Images_24bit.bmp
├── add_cloud.xcf
├── apps.png
├── cloud_droplet.png
├── cloud_foundry_eclipse_icon.png
├── cloud_foundry_icon.ico
├── cloud_foundry_logo.png
├── cloud_foundry_logo_400.png
├── cloud_foundry_logo_600.png
├── cloud_play.png
├── collapsed.png
├── deploy.png
├── expanded.png
├── server.png
├── start.png
└── stop.png
├── lib
├── AsproLock
│ ├── AsproLock.dll
│ ├── AsproLock.pdb
│ └── AsproLock.xml
├── CommandLine
│ ├── CommandLine.XML
│ ├── CommandLine.dll
│ └── CommandLine.pdb
├── NDesk.Options.dll
├── OldDlls
│ ├── NDesk.Options-old.dll
│ ├── NDesk.Options.il
│ └── NDesk.Options.res
├── README.txt
└── RestSharp
│ ├── RestSharp.dll
│ ├── RestSharp.pdb
│ └── RestSharp.xml
├── src
├── IronFoundry.Bosh.Monit
│ ├── IIsMonitor.cs
│ ├── IMonitor.cs
│ ├── IronFoundry.Bosh.Monit.csproj
│ └── Properties
│ │ └── AssemblyInfo.cs
├── IronFoundry.Bosh.Service
│ ├── App.config
│ ├── CloudFoundrySmall.ico
│ ├── IronFoundry.Bosh.Service.csproj
│ ├── Program.cs
│ └── Properties
│ │ └── AssemblyInfo.cs
├── IronFoundry.Bosh.Test
│ ├── App.config
│ ├── Blobstore.cs
│ ├── CompilePackageTests.cs
│ ├── EjectTest.cs
│ ├── IronFoundry.Bosh.Test.csproj
│ ├── IronFoundry.Bosh.Test.xunit
│ ├── JsonTests.cs
│ ├── LoggingTests.cs
│ ├── NoopLogger.cs
│ ├── PowershellTests.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── TestBoshConfig.cs
│ ├── XmlParsing.cs
│ ├── iis-setup.tgz
│ └── packages.config
├── IronFoundry.Bosh
│ ├── Agent
│ │ ├── AgentException.cs
│ │ ├── BoshAgent.cs
│ │ ├── BoshAgentSubscription.cs
│ │ ├── EjectMedia.cs
│ │ ├── Handlers
│ │ │ ├── Apply.cs
│ │ │ ├── BaseMessageHandler.cs
│ │ │ ├── CompilePackage.cs
│ │ │ ├── Drain.cs
│ │ │ ├── FetchLogs.cs
│ │ │ ├── GetTask.cs
│ │ │ ├── HandlerResponse.cs
│ │ │ ├── IMessageHandler.cs
│ │ │ ├── ListDisk.cs
│ │ │ ├── MigrateDisk.cs
│ │ │ ├── MountDisk.cs
│ │ │ ├── Noop.cs
│ │ │ ├── Ping.cs
│ │ │ ├── PrepareNetworkChange.cs
│ │ │ ├── Shutdown.cs
│ │ │ ├── Ssh.cs
│ │ │ ├── Start.cs
│ │ │ ├── State.cs
│ │ │ ├── StateResult.cs
│ │ │ ├── Stop.cs
│ │ │ ├── UnmountDisk.cs
│ │ │ └── UploadResult.cs
│ │ ├── HeartbeatProcessor.cs
│ │ ├── MessageHandlerException.cs
│ │ ├── RemoteException.cs
│ │ └── VMSetupState.cs
│ ├── Blobstore
│ │ ├── BlobstoreClient.cs
│ │ ├── BlobstoreClientFactory.cs
│ │ ├── BlobstoreException.cs
│ │ ├── BlobstoreOptions.cs
│ │ ├── IBlobstoreClient.cs
│ │ ├── IBlobstoreClientFactory.cs
│ │ └── SimpleBlobstoreClient.cs
│ ├── Configuration
│ │ ├── BoshConfig.cs
│ │ ├── HeartbeatStateData.cs
│ │ └── IBoshConfig.cs
│ ├── IoC
│ │ └── BoshRegistry.cs
│ ├── IronFoundry.Bosh.csproj
│ ├── Messages
│ │ └── Heartbeat.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ ├── Resources
│ │ └── unattend.xml
│ ├── Settings.StyleCop
│ ├── Types
│ │ └── Spec.cs
│ ├── Utilities
│ │ └── NetworkConfigurator.cs
│ └── packages.config
├── IronFoundry.CloudFoundryExplorer.Installer
│ ├── Banner.bmp
│ ├── IronFoundry.CloudFoundryExplorer.Installer.wixproj
│ ├── License.rtf
│ ├── Product.wxs
│ ├── README_wixproj.txt
│ └── WelcomeBanner.bmp
├── IronFoundry.CloudFoundryExplorer
│ ├── App.config
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── CloudFoundrySmall.ico
│ ├── IronFoundry.CloudFoundryExplorer.csproj
│ ├── IronFoundry.snk
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ └── packages.config
├── IronFoundry.Dea.Service.Installer
│ ├── Banner.bmp
│ ├── IronFoundry.Dea.Service.Installer.wixproj
│ ├── License.rtf
│ ├── Product.wxs
│ ├── README_wixproj.txt
│ ├── ServiceConfigDialog.wxi
│ ├── WelcomeBanner.bmp
│ └── install.ps1
├── IronFoundry.Dea.Service
│ ├── App.config
│ ├── CloudFoundrySmall.ico
│ ├── IronFoundry.Dea.Service.csproj
│ ├── IronFoundry.snk
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── packages.config
├── IronFoundry.Dea
│ ├── Agent
│ │ ├── ConfigManager.cs
│ │ ├── DeaAgent.cs
│ │ ├── DropletManager.cs
│ │ ├── FileData.cs
│ │ ├── FilesManager.cs
│ │ ├── IConfigManager.cs
│ │ ├── IDropletManager.cs
│ │ └── IFilesManager.cs
│ ├── Configuration
│ │ ├── DeaConfig.cs
│ │ ├── DeaSection.cs
│ │ ├── IDeaConfig.cs
│ │ └── ServiceCredential.cs
│ ├── Constants.cs
│ ├── Extensions
│ │ ├── DateTimeExtensionMethods.cs
│ │ ├── FloatExtensionMethods.cs
│ │ └── TaskExtensionMethods.cs
│ ├── IoC
│ │ └── DeaRegistry.cs
│ ├── IronFoundry.Dea.csproj
│ ├── IronFoundry.snk
│ ├── JsonConverters
│ │ ├── IPAddressConverter.cs
│ │ ├── VcapDateTimeConverter.cs
│ │ ├── VcapGuidArrayConverter.cs
│ │ └── VcapGuidConverter.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ ├── Providers
│ │ ├── HealthzProvider.cs
│ │ ├── IHealthzProvider.cs
│ │ ├── IVarzProvider.cs
│ │ ├── IWebOperationContextProvider.cs
│ │ ├── IWebServerAdministrationProvider.cs
│ │ ├── NatsSubscription.cs
│ │ ├── VarzProvider.cs
│ │ ├── WebOperationContextProvider.cs
│ │ └── WebServerAdministrationProvider.cs
│ ├── Services
│ │ ├── CustomUserNamePasswordValidator.cs
│ │ ├── FilesService.cs
│ │ ├── FirewallService.cs
│ │ ├── IFilesService.cs
│ │ ├── IFirewallService.cs
│ │ ├── IMonitoringService.cs
│ │ └── MonitoringService.cs
│ ├── Types
│ │ ├── Advertise.cs
│ │ ├── Discover.cs
│ │ ├── Droplet.cs
│ │ ├── DropletEntry.cs
│ │ ├── DropletHeartbeat.cs
│ │ ├── EntityBase.cs
│ │ ├── FindDroplet.cs
│ │ ├── FindDropletResponse.cs
│ │ ├── Heartbeat.cs
│ │ ├── Hello.cs
│ │ ├── Instance.cs
│ │ ├── InstanceEntry.cs
│ │ ├── InstanceExited.cs
│ │ ├── Limits.cs
│ │ ├── Message.cs
│ │ ├── Metric.cs
│ │ ├── RouterRegister.cs
│ │ ├── RouterUnregister.cs
│ │ ├── Service.cs
│ │ ├── Snapshot.cs
│ │ ├── SocketErrorCode.cs
│ │ ├── Stats.cs
│ │ ├── Status.cs
│ │ ├── StopDroplet.cs
│ │ ├── Tag.cs
│ │ ├── Usage.cs
│ │ ├── VcapComponentAnnounce.cs
│ │ ├── VcapComponentBase.cs
│ │ ├── VcapComponentDiscover.cs
│ │ ├── VcapResponse.cs
│ │ └── VcapStates.cs
│ ├── WcfInfrastructure
│ │ ├── IocInstanceProvider.cs
│ │ ├── IocServiceBehavior.cs
│ │ ├── IocServiceBehaviorUtil.cs
│ │ ├── IocServiceHost.cs
│ │ ├── PerCallServiceHost.cs
│ │ └── WcfWinService.cs
│ ├── WinService
│ │ ├── FilesWinService.cs
│ │ ├── MonitoringWinService.cs
│ │ └── ValidationWinService.cs
│ └── packages.config
├── IronFoundry.Misc
│ ├── Agent
│ │ └── IAgent.cs
│ ├── IoC
│ │ ├── Bootstrapper.cs
│ │ └── ServiceRegistry.cs
│ ├── IronFoundry.Misc.csproj
│ ├── IronFoundry.snk
│ ├── Logging
│ │ ├── ILog.cs
│ │ └── NLogLogger.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ ├── Utilities.cs
│ ├── Utilities
│ │ ├── ActionTimer.cs
│ │ ├── DirectoryScope.cs
│ │ ├── ExecCmd.cs
│ │ ├── ExecCmdResult.cs
│ │ ├── PowershellExecutor.cs
│ │ └── RedirectedProcess.cs
│ ├── WinService
│ │ ├── AgentWinService.cs
│ │ ├── CustomCommands.cs
│ │ ├── IService.cs
│ │ ├── MultipleServiceManager.cs
│ │ ├── ServiceMain.cs
│ │ └── ServiceStatusUtil.cs
│ └── packages.config
├── IronFoundry.Nats
│ ├── Client
│ │ ├── Connect.cs
│ │ ├── INatsClient.cs
│ │ ├── INatsMessage.cs
│ │ ├── INatsSubscription.cs
│ │ ├── NatsClient.cs
│ │ ├── NatsCommand.cs
│ │ └── NatsMessage.cs
│ ├── Configuration
│ │ ├── INatsConfig.cs
│ │ ├── NatsConfig.cs
│ │ └── NatsSection.cs
│ ├── IoC
│ │ └── NatsRegistry.cs
│ ├── IronFoundry.Nats.csproj
│ ├── IronFoundry.snk
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ └── packages.config
├── IronFoundry.Test
│ ├── .gitignore
│ ├── App.config
│ ├── CredentialManagerTests.cs
│ ├── FirewallTests.cs
│ ├── FrameworkDetectorTests.cs
│ ├── IronFoundry.Test.csproj
│ ├── IronFoundry.Test.csproj.user
│ ├── IronFoundry.Test.xunit
│ ├── IronFoundry.snk
│ ├── JsonTests.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── TimerTests.cs
│ ├── UserTests.cs
│ ├── UtilitiesTest.cs
│ ├── VcapClientTests.cs
│ ├── packages.config
│ └── testapp.war
├── IronFoundry.Ui.Controls
│ ├── CloudFoundrySmall.ico
│ ├── Converters
│ │ ├── CsvConverter.cs
│ │ ├── IsNullConverter.cs
│ │ ├── MinutesConverter.cs
│ │ └── TitleCaseConverter.cs
│ ├── Images
│ │ ├── CloudFoundrySmall.ico
│ │ ├── add.png
│ │ ├── add_cloud.png
│ │ ├── apps.png
│ │ ├── appsadd.png
│ │ ├── cloud_add.png
│ │ ├── cloud_droplet.png
│ │ ├── cloud_foundry_eclipse_icon.png
│ │ ├── cloud_foundry_logo_400.png
│ │ ├── cloud_play.png
│ │ ├── editurls.png
│ │ ├── gear.png
│ │ ├── refresh.png
│ │ ├── server.png
│ │ ├── serveradd.png
│ │ ├── service.png
│ │ ├── serviceadd.png
│ │ ├── start.png
│ │ ├── stop.png
│ │ └── update.png
│ ├── IronFoundry.Ui.Controls.csproj
│ ├── IronFoundry.snk
│ ├── Model
│ │ ├── CloudEventArgs.cs
│ │ ├── CloudFoundryProvider.cs
│ │ ├── CloudUpdate.cs
│ │ ├── ICloudFoundryProvider.cs
│ │ ├── IPreferencesProvider.cs
│ │ ├── PreferencesProvider.cs
│ │ └── ProviderResponse.cs
│ ├── Mvvm
│ │ ├── DialogViewModel.cs
│ │ ├── DragSource.cs
│ │ ├── DragSourceBehavior.cs
│ │ ├── DropTarget.cs
│ │ ├── DropTargetBehavior.cs
│ │ ├── IDragSource.cs
│ │ ├── IDropTarget.cs
│ │ ├── ProgressError.cs
│ │ ├── ProgressMessage.cs
│ │ └── TreeViewItemViewModel.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── Resources
│ │ └── Resources.xaml
│ ├── UserControls
│ │ ├── ucSpinnerApple.xaml
│ │ └── ucSpinnerApple.xaml.cs
│ ├── Utilities
│ │ ├── IconUtil.cs
│ │ ├── Messages.cs
│ │ └── PasswordHelper.cs
│ ├── ViewModel
│ │ ├── Cloud
│ │ │ ├── AddApplicationUrlViewModel.cs
│ │ │ ├── ChangePasswordViewModel.cs
│ │ │ ├── CloudViewModel.cs
│ │ │ ├── CreateServiceViewModel.cs
│ │ │ └── ManageApplicationUrlsViewModel.cs
│ │ ├── Explorer
│ │ │ ├── ApplicationTreeViewItemViewModel.cs
│ │ │ ├── CloudExplorerViewModel.cs
│ │ │ ├── CloudTreeViewItemViewModel.cs
│ │ │ ├── FileTreeViewItemViewModel.cs
│ │ │ ├── FolderTreeViewItemViewModel.cs
│ │ │ └── InstanceTreeViewItemViewModel.cs
│ │ ├── ExplorerViewModel.cs
│ │ ├── ManageCloudsViewModel.cs
│ │ ├── ProgressViewModel.cs
│ │ ├── Push
│ │ │ ├── AddApplicationServiceViewModel.cs
│ │ │ └── PushViewModel.cs
│ │ ├── UpdateViewModel.cs
│ │ └── ViewModelBase.cs
│ ├── Views
│ │ ├── AddApplicationService.xaml
│ │ ├── AddApplicationService.xaml.cs
│ │ ├── AddApplicationUrl.xaml
│ │ ├── AddApplicationUrl.xaml.cs
│ │ ├── ChangePassword.xaml
│ │ ├── ChangePassword.xaml.cs
│ │ ├── CloudExplorer.xaml
│ │ ├── CloudExplorer.xaml.cs
│ │ ├── CloudView.xaml
│ │ ├── CloudView.xaml.cs
│ │ ├── CreateService.xaml
│ │ ├── CreateService.xaml.cs
│ │ ├── Explorer.xaml
│ │ ├── Explorer.xaml.cs
│ │ ├── ManageApplicationUrls.xaml
│ │ ├── ManageApplicationUrls.xaml.cs
│ │ ├── ManageClouds.xaml
│ │ ├── ManageClouds.xaml.cs
│ │ ├── ProgressDialog.xaml
│ │ ├── ProgressDialog.xaml.cs
│ │ ├── Push.xaml
│ │ ├── Push.xaml.cs
│ │ ├── Update.xaml
│ │ └── Update.xaml.cs
│ ├── app.config
│ └── packages.config
├── IronFoundry.VisualStudioExtension
│ ├── CloudFoundryPackage.cs
│ ├── CloudFoundryPackage.vsct
│ ├── Guids.cs
│ ├── IronFoundry.VisualStudioExtension.csproj
│ ├── IronFoundry.snk
│ ├── PkgCmdID.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── ProvideBindingPathAttribute.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Resources
│ │ ├── LICENSE.txt
│ │ ├── cloud_play.png
│ │ └── deploy.png
│ ├── VSPackage.resx
│ ├── VisualStudioExtensions.cs
│ ├── app.config
│ ├── packages.config
│ └── source.extension.vsixmanifest
├── IronFoundry.Warden.IISHost
│ ├── App.config
│ ├── ConfigGenerator.cs
│ ├── Constants.cs
│ ├── IronFoundry.Warden.IISHost.csproj
│ ├── Program.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ ├── Readme.txt
│ ├── Resources
│ │ ├── applicationhost.config
│ │ ├── aspnet.config
│ │ ├── redirection.config
│ │ └── v2.0AppHost.config
│ ├── WebCoreActivationException.cs
│ ├── WebServer.cs
│ ├── XmlExtensions.cs
│ └── packages.config
├── IronFoundry.Warden.Protocol
│ ├── Constants.cs
│ ├── CopyAndFixUpProto.ps1
│ ├── IContainerRequest.cs
│ ├── ITaskRequest.cs
│ ├── IronFoundry.Warden.Protocol.csproj
│ ├── MessageUnwrapper.cs
│ ├── Messages.cs
│ ├── Messages
│ │ ├── CopyInRequest.cs
│ │ ├── CopyInResponse.cs
│ │ ├── CopyOutRequest.cs
│ │ ├── CopyOutResponse.cs
│ │ ├── CreateRequest.cs
│ │ ├── CreateResponse.cs
│ │ ├── DestroyRequest.cs
│ │ ├── DestroyResponse.cs
│ │ ├── EchoRequest.cs
│ │ ├── EchoResponse.cs
│ │ ├── ErrorResponse.cs
│ │ ├── ICopyRequest.cs
│ │ ├── InfoRequest.cs
│ │ ├── InfoResponse.cs
│ │ ├── LimitBandwidthRequest.cs
│ │ ├── LimitBandwidthResponse.cs
│ │ ├── LimitDiskRequest.cs
│ │ ├── LimitDiskResponse.cs
│ │ ├── LimitMemoryRequest.cs
│ │ ├── LimitMemoryResponse.cs
│ │ ├── LinkRequest.cs
│ │ ├── LinkResponse.cs
│ │ ├── ListRequest.cs
│ │ ├── ListResponse.cs
│ │ ├── NetInRequest.cs
│ │ ├── NetInResponse.cs
│ │ ├── NetOutRequest.cs
│ │ ├── NetOutResponse.cs
│ │ ├── PingRequest.cs
│ │ ├── PingResponse.cs
│ │ ├── ResourceLimits.cs
│ │ ├── RunRequest.cs
│ │ ├── RunResponse.cs
│ │ ├── SpawnRequest.cs
│ │ ├── SpawnResponse.cs
│ │ ├── StopRequest.cs
│ │ ├── StopResponse.cs
│ │ ├── StreamRequest.cs
│ │ └── StreamResponse.cs
│ ├── ParseProto.ps1
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Request.cs
│ ├── Response.cs
│ ├── ResponseWrapper.cs
│ ├── WardenException.cs
│ ├── packages.config
│ ├── pb
│ │ ├── copy_in.proto
│ │ ├── copy_out.proto
│ │ ├── create.proto
│ │ ├── destroy.proto
│ │ ├── echo.proto
│ │ ├── error.proto
│ │ ├── info.proto
│ │ ├── limit_bandwidth.proto
│ │ ├── limit_disk.proto
│ │ ├── limit_memory.proto
│ │ ├── link.proto
│ │ ├── list.proto
│ │ ├── message.proto
│ │ ├── net_in.proto
│ │ ├── net_out.proto
│ │ ├── ping.proto
│ │ ├── resource_limits.proto
│ │ ├── run.proto
│ │ ├── spawn.proto
│ │ ├── stop.proto
│ │ └── stream.proto
│ └── tools
│ │ └── protogen
│ │ ├── .gitignore
│ │ ├── Licence.txt
│ │ ├── common.xslt
│ │ ├── csharp.xslt
│ │ ├── descriptor.proto
│ │ ├── protobuf-net.dll
│ │ ├── protobuf-net.pdb
│ │ ├── protobuf-net.xml
│ │ ├── protoc-license.txt
│ │ ├── protogen.exe
│ │ ├── protogen.exe.config
│ │ ├── protogen.pdb
│ │ ├── vb.xslt
│ │ └── xml.xslt
├── IronFoundry.Warden.Service.Installer
│ ├── Banner.bmp
│ ├── IronFoundry.Warden.Service.Installer.wixproj
│ ├── License.rtf
│ ├── Product.wxs
│ ├── ServiceConfigDialog.wxi
│ ├── ServiceConfigDialog_Validation.wxi
│ └── WelcomeBanner.bmp
├── IronFoundry.Warden.Service.InstallerCA
│ ├── CustomAction.config
│ ├── CustomAction.cs
│ ├── IronFoundry.Warden.Service.InstallerCA.csproj
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── SessionLogger.cs
│ └── Win32
│ │ └── LogonUser.cs
├── IronFoundry.Warden.Service
│ ├── App.config
│ ├── CloudFoundrySmall.ico
│ ├── Constants.cs
│ ├── IronFoundry.Warden.Service.csproj
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── WinService.cs
│ ├── WinServiceInstaller.cs
│ └── packages.config
├── IronFoundry.Warden.Test
│ ├── ContainerHandleTests.cs
│ ├── IronFoundry.Warden.Test.csproj
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── packages.config
├── IronFoundry.Warden
│ ├── Configuration
│ │ ├── WardenConfig.cs
│ │ └── WardenSection.cs
│ ├── Containers
│ │ ├── Container.cs
│ │ ├── ContainerDirectory.cs
│ │ ├── ContainerHandle.cs
│ │ ├── ContainerManager.cs
│ │ ├── ContainerPort.cs
│ │ ├── ContainerState.cs
│ │ ├── ContainerUser.cs
│ │ ├── IContainerManager.cs
│ │ └── InfoBuilder.cs
│ ├── Handlers
│ │ ├── ContainerRequestHandler.cs
│ │ ├── CopyInRequestHandler.cs
│ │ ├── CopyOutRequestHandler.cs
│ │ ├── CopyRequestHandler.cs
│ │ ├── CreateRequestHandler.cs
│ │ ├── DestroyRequestHandler.cs
│ │ ├── EchoRequestHandler.cs
│ │ ├── IStreamingHandler.cs
│ │ ├── InfoRequestHandler.cs
│ │ ├── JobRequestHandler.cs
│ │ ├── LimitBandwidthRequestHandler.cs
│ │ ├── LimitDiskRequestHandler.cs
│ │ ├── LimitMemoryRequestHandler.cs
│ │ ├── LinkRequestHandler.cs
│ │ ├── ListRequestHandler.cs
│ │ ├── NetInRequestHandler.cs
│ │ ├── NetOutRequestHandler.cs
│ │ ├── PingRequestHandler.cs
│ │ ├── RequestHandler.cs
│ │ ├── RequestHandlerFactory.cs
│ │ ├── ResponseData.cs
│ │ ├── RunRequestHandler.cs
│ │ ├── SpawnRequestHandler.cs
│ │ ├── StopRequestHandler.cs
│ │ ├── StreamRequestHandler.cs
│ │ └── TaskRequestHandler.cs
│ ├── IronFoundry.Warden.csproj
│ ├── Jobs
│ │ ├── IJobListener.cs
│ │ ├── IJobManager.cs
│ │ ├── IJobResult.cs
│ │ ├── IJobRunnable.cs
│ │ ├── IJobStatus.cs
│ │ ├── Job.cs
│ │ ├── JobExceptionResult.cs
│ │ ├── JobManager.cs
│ │ └── JobStatusEventArgs.cs
│ ├── PInvoke
│ │ ├── CloseHandle.cs
│ │ ├── Constants.cs
│ │ ├── DuplicateTokenEx.cs
│ │ ├── Enums.cs
│ │ ├── GetCurrentThreadId.cs
│ │ ├── GetLengthSid.cs
│ │ ├── GetProcessWindowStation.cs
│ │ ├── GetThreadDesktop.cs
│ │ ├── GetTokenInformation.cs
│ │ ├── LogonUser.cs
│ │ ├── LookupAccountSid.cs
│ │ ├── NativeMethods.cs
│ │ ├── OpenProcessToken.cs
│ │ ├── RevertToSelf.cs
│ │ ├── SafeUserTokenHandle.cs
│ │ ├── SecurityAttributes.cs
│ │ ├── Structs.cs
│ │ └── Utils.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ ├── Server
│ │ ├── Buffer.cs
│ │ ├── MessageHandler.cs
│ │ ├── SocketExceptionHandler.cs
│ │ ├── TcpServer.cs
│ │ ├── WardenClient.cs
│ │ └── WardenExceptionHandler.cs
│ ├── Tasks
│ │ ├── ExeCommand.cs
│ │ ├── MkdirCommand.cs
│ │ ├── PathCommand.cs
│ │ ├── PowershellCommand.cs
│ │ ├── ProcessCommand.cs
│ │ ├── ReplaceTokensCommand.cs
│ │ ├── TarCommand.cs
│ │ ├── TaskCommand.cs
│ │ ├── TaskCommandDTO.cs
│ │ ├── TaskCommandFactory.cs
│ │ ├── TaskCommandResult.cs
│ │ ├── TaskCommandStatus.cs
│ │ ├── TaskCommandStatusEventArgs.cs
│ │ ├── TaskRunner.cs
│ │ ├── TouchCommand.cs
│ │ ├── UnzipCommand.cs
│ │ └── WebApplicationCommand.cs
│ ├── Utilities
│ │ ├── BackgroundProcess.cs
│ │ ├── DesktopPermissionManager.cs
│ │ ├── FirewallManager.cs
│ │ ├── IPUtilities.cs
│ │ ├── Impersonator.cs
│ │ ├── LocalPrincipalData.cs
│ │ ├── LocalPrincipalManager.cs
│ │ ├── LocalTcpPortManager.cs
│ │ ├── LoggedIEnumerableExtensionMethods.cs
│ │ ├── LoggerExtensionMethods.cs
│ │ ├── MessageWriter.cs
│ │ ├── ProcessExtensionMethods.cs
│ │ ├── ProcessManager.cs
│ │ ├── Statics.cs
│ │ └── TempFile.cs
│ └── packages.config
├── IronFoundry
│ ├── Extensions
│ │ ├── ObjectExtensionMethods.cs
│ │ ├── SafeObservableCollection.cs
│ │ └── UriExtensionMethods.cs
│ ├── IronFoundry.csproj
│ ├── IronFoundry.snk
│ ├── Models
│ │ ├── AccessToken.cs
│ │ ├── AppServer.cs
│ │ ├── Application.cs
│ │ ├── Cloud.cs
│ │ ├── CloudUrl.cs
│ │ ├── Crash.cs
│ │ ├── EntityBase.cs
│ │ ├── ExternalInstance.cs
│ │ ├── Framework.cs
│ │ ├── IMergeable.cs
│ │ ├── Info.cs
│ │ ├── InfoLimits.cs
│ │ ├── InfoUsage.cs
│ │ ├── Instance.cs
│ │ ├── Limits.cs
│ │ ├── Message.cs
│ │ ├── Preferences.cs
│ │ ├── PreferencesV2.cs
│ │ ├── ProvisionedService.cs
│ │ ├── Runtime.cs
│ │ ├── StatInfo.cs
│ │ ├── Stats.cs
│ │ ├── SystemService.cs
│ │ ├── SystemServiceEqualityComparer.cs
│ │ ├── Usage.cs
│ │ ├── VcapResponse.cs
│ │ ├── VcapUser.cs
│ │ └── VcapUserApp.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ ├── Utilities
│ │ ├── Constants.cs
│ │ ├── CustomSerializationBinder.cs
│ │ ├── NewtonsoftJsonDeserializer.cs
│ │ ├── NewtonsoftJsonSerializer.cs
│ │ └── Utilities.cs
│ ├── Vcap
│ │ ├── AppsHelper.cs
│ │ ├── BaseVmcHelper.cs
│ │ ├── Constants.cs
│ │ ├── Entities.cs
│ │ ├── FrameworkDetetctor.cs
│ │ ├── IVcapClient.cs
│ │ ├── InfoHelper.cs
│ │ ├── MiscHelper.cs
│ │ ├── ServicesHelper.cs
│ │ ├── UserHelper.cs
│ │ ├── VcapClient.cs
│ │ ├── VcapClientResult.cs
│ │ ├── VcapCredentialManager.cs
│ │ ├── VcapExceptions.cs
│ │ ├── VcapFilesResult.cs
│ │ └── VcapRequest.cs
│ └── packages.config
├── shared
│ ├── CommonAssemblyInfo.cs
│ └── ExtensionMethods.cs
└── wixshared
│ └── IronFoundryShared.wxi
└── tools
├── ab.exe
├── dea-monitor.rb
├── iis_cleanup.ps1
├── profile-functions.ps1
├── start-apps.rb
└── stop-apps.rb
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Set default behaviour, in case users don't have core.autocrlf set.
2 | * text=auto
3 |
4 | # Explicitly declare text files we want to always be normalized and converted
5 | # to native line endings on checkout.
6 | *.cs text
7 |
8 | # Declare files that will always have CRLF line endings on checkout.
9 | *.csproj text eol=crlf
10 | *.sln text eol=crlf
11 |
12 | # Denote all files that are truly binary and should not be modified.
13 | *.exe binary
14 | *.png binary
15 | *.jpg binary
16 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | bin/
2 | obj/
3 | *.exe
4 | *.suo
5 | packages/
6 | *.user
7 | _ReSharper.IronFoundry/
8 | /_ReSharper.IronFoundry/
9 | *.Publish.xml
10 | /.JustCode/
11 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "src/IronFoundry.Warden.Protocol/warden"]
2 | path = src/IronFoundry.Warden.Protocol/warden
3 | url = https://github.com/cloudfoundry/warden.git
4 |
--------------------------------------------------------------------------------
/BUILD.md:
--------------------------------------------------------------------------------
1 | Building Iron Foundry .NET source
2 | ---------------------------------
3 |
4 | * Prerequisites:
5 | * Visual Studio (2012 Update 2 currently used for development)
6 | * .NET Framework 4.5
7 | * WiX (http://wixtoolset.org/)
8 |
9 | * Before running Visual Studio:
10 | * Run `build.bat`. It will restore NuGet packages and do a Release-x64 build, which will also create installers.
11 |
12 | * You're all set!
13 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Iron Foundry is an implementation of Cloud Foundry that is tightly integrated with the .NET Framework. It can support multiple frameworks, cloud providers, and application services all on a cloud scale platform.
2 |
3 | Find out more at http://www.ironfoundry.org/
4 |
5 | See the [build instructions](BUILD.md) for how to build from source locally.
6 |
--------------------------------------------------------------------------------
/build.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | setlocal EnableExtensions
3 |
4 | if (%FrameworkDir%)==() set FrameworkDir=%WINDIR%\Microsoft.NET\Framework64\
5 | if (%FrameworkVersion%)==() set FrameworkVersion=v4.0.30319
6 |
7 | set MSBUILD=%FrameworkDir%%FrameworkVersion%\msbuild.exe
8 |
9 | if not exist %MSBUILD% goto Error_NoMsBuild
10 |
11 | set TARGET=%1
12 | if (%TARGET%)==() set TARGET=Default
13 |
14 | set VERBOSITY=%2
15 | if (%VERBOSITY%)==() set VERBOSITY=minimal
16 |
17 | %MSBUILD% /verbosity:%VERBOSITY% /nologo /m /t:%TARGET% %~dp0build/build.proj
18 |
19 | if errorlevel 1 goto Error_BuildFailed
20 |
21 | echo.
22 | echo *** BUILD SUCCESSFUL ***
23 | echo.
24 | goto :EOF
25 |
26 | :Error_BuildFailed
27 | echo.
28 | echo *** BUILD FAILED ***
29 | echo.
30 | exit /b 1
31 |
32 | :Error_NoMsBuild
33 | echo.
34 | echo. ERROR: Unable to locate MSBuild.exe (expected location: %MSBUILD%)
35 | echo.
36 | exit /b 1
37 |
--------------------------------------------------------------------------------
/build/MSBuildTasks/MSBuildTasks.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/build/MSBuildTasks/MSBuildTasks.nupkg
--------------------------------------------------------------------------------
/build/MSBuildTasks/tools/MSBuild.Community.Tasks.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/build/MSBuildTasks/tools/MSBuild.Community.Tasks.dll
--------------------------------------------------------------------------------
/build/build.proj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | $([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\..\'))
6 | Release
7 | x64
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/build/xunit.runners/tools/xunit.abstractions.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/build/xunit.runners/tools/xunit.abstractions.dll
--------------------------------------------------------------------------------
/build/xunit.runners/tools/xunit.runner.msbuild.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/build/xunit.runners/tools/xunit.runner.msbuild.dll
--------------------------------------------------------------------------------
/build/xunit.runners/tools/xunit.runner.utility.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/build/xunit.runners/tools/xunit.runner.utility.dll
--------------------------------------------------------------------------------
/build/xunit.runners/xunit.runners.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/build/xunit.runners/xunit.runners.nupkg
--------------------------------------------------------------------------------
/common/IronFoundry.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/common/IronFoundry.snk
--------------------------------------------------------------------------------
/docs/licenses/ab.exe.txt:
--------------------------------------------------------------------------------
1 | http://httpd.apache.org/docs/2.4/license.html
2 |
3 | ab.exe is part of the httpd distribution.
4 |
--------------------------------------------------------------------------------
/docs/licenses/asprosys.txt:
--------------------------------------------------------------------------------
1 | http://www.asprosys.com/Resources/Samples/codesamples.aspx
2 | http://asprosys.blogspot.com/2009/03/perils-and-pitfalls-of-launching.html
3 |
4 | Code Samples for Developers
5 |
6 | All code samples linked from here are put in the public domain unless
7 | explicitly licensed differently in the source code itself. You may use them
8 | however you wish but we would appreciate proper attribution, please do not pass
9 | these off as your own work. The code is provided "AS IS" it carries no
10 | guarantees at all.
11 |
--------------------------------------------------------------------------------
/docs/warden-tests.txt:
--------------------------------------------------------------------------------
1 | run --handle 16vitn5mcmq --script '[{"cmd":"exe","args":["cmd","/c whoami >> C:\\tmp\\whoami.out"]}]'
2 | run --handle 16vitn5mcmq --script '[{"cmd":"ps1","args":["$c=0","while($c -lt 10){","++$c","$me=$(whoami)","Write-Host \"$c : $me\"","Start-Sleep -s 1","}"]}]'
3 |
--------------------------------------------------------------------------------
/images/CloudFoundrySmall.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/images/CloudFoundrySmall.ico
--------------------------------------------------------------------------------
/images/Images_24bit.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/images/Images_24bit.bmp
--------------------------------------------------------------------------------
/images/add_cloud.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/images/add_cloud.xcf
--------------------------------------------------------------------------------
/images/apps.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/images/apps.png
--------------------------------------------------------------------------------
/images/cloud_droplet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/images/cloud_droplet.png
--------------------------------------------------------------------------------
/images/cloud_foundry_eclipse_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/images/cloud_foundry_eclipse_icon.png
--------------------------------------------------------------------------------
/images/cloud_foundry_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/images/cloud_foundry_icon.ico
--------------------------------------------------------------------------------
/images/cloud_foundry_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/images/cloud_foundry_logo.png
--------------------------------------------------------------------------------
/images/cloud_foundry_logo_400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/images/cloud_foundry_logo_400.png
--------------------------------------------------------------------------------
/images/cloud_foundry_logo_600.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/images/cloud_foundry_logo_600.png
--------------------------------------------------------------------------------
/images/cloud_play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/images/cloud_play.png
--------------------------------------------------------------------------------
/images/collapsed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/images/collapsed.png
--------------------------------------------------------------------------------
/images/deploy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/images/deploy.png
--------------------------------------------------------------------------------
/images/expanded.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/images/expanded.png
--------------------------------------------------------------------------------
/images/server.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/images/server.png
--------------------------------------------------------------------------------
/images/start.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/images/start.png
--------------------------------------------------------------------------------
/images/stop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/images/stop.png
--------------------------------------------------------------------------------
/lib/AsproLock/AsproLock.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/lib/AsproLock/AsproLock.dll
--------------------------------------------------------------------------------
/lib/AsproLock/AsproLock.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/lib/AsproLock/AsproLock.pdb
--------------------------------------------------------------------------------
/lib/CommandLine/CommandLine.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/lib/CommandLine/CommandLine.dll
--------------------------------------------------------------------------------
/lib/CommandLine/CommandLine.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/lib/CommandLine/CommandLine.pdb
--------------------------------------------------------------------------------
/lib/NDesk.Options.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/lib/NDesk.Options.dll
--------------------------------------------------------------------------------
/lib/OldDlls/NDesk.Options-old.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/lib/OldDlls/NDesk.Options-old.dll
--------------------------------------------------------------------------------
/lib/OldDlls/NDesk.Options.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/lib/OldDlls/NDesk.Options.res
--------------------------------------------------------------------------------
/lib/README.txt:
--------------------------------------------------------------------------------
1 | Re-signed DLLs:
2 |
3 | In order to allow use of these libraries within a Visual Studio Extension,
4 | these libraries were disassembled using ILDASM, signed with the Iron Foundry key
5 | from ../common/IronFoundry.snk and reassembled using ILASM as .NET 4.0 assemblies.
6 |
7 | NDesk.Options.dll
8 |
9 | In order to faciliate upgrade of these components, resigning will need to occur again. Please reference:
10 |
11 | http://buffered.io/2008/07/09/net-fu-signing-an-unsigned-assembly-without-delay-signing/
12 |
13 | Thanks, the Iron Foundry team
14 |
--------------------------------------------------------------------------------
/lib/RestSharp/RestSharp.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/lib/RestSharp/RestSharp.dll
--------------------------------------------------------------------------------
/lib/RestSharp/RestSharp.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/lib/RestSharp/RestSharp.pdb
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh.Monit/IMonitor.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Monit
2 | {
3 | public interface IMonitor
4 | {
5 | void Start();
6 | void Stop();
7 | object Status();
8 | }
9 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh.Service/CloudFoundrySmall.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Bosh.Service/CloudFoundrySmall.ico
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh.Service/Program.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Service
2 | {
3 | using IronFoundry.Misc.WinService;
4 |
5 | static class Program
6 | {
7 | static void Main(string[] args)
8 | {
9 | ServiceMain.Start(args);
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh.Service/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | [assembly: AssemblyTitle("IronFoundry.Bosh.Service")]
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh.Test/Blobstore.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Test
2 | {
3 | using System;
4 | using IronFoundry.Bosh.Blobstore;
5 | using Xunit;
6 |
7 | public class Blobstore
8 | {
9 | [Fact(Skip="MANUAL")]
10 | public void Can_Upload_File()
11 | {
12 | var options = new BlobstoreOptions(new Uri("http://172.21.10.181:25250"), "agent", "agent");
13 | var client = new SimpleBlobstoreClient(options);
14 | string response = client.Create(@"C:\proj\tmp\env.iso");
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh.Test/IronFoundry.Bosh.Test.xunit:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh.Test/JsonTests.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Test
2 | {
3 | using IronFoundry.Bosh.Agent.Handlers;
4 | using Xunit;
5 |
6 | public class JsonTests
7 | {
8 | [Fact]
9 | public void Serializes_Upload_Result()
10 | {
11 | object result = Test();
12 | var response = new HandlerResponse(result);
13 | string json = response.ToJson();
14 | }
15 |
16 | private object Test()
17 | {
18 | return new { result = new { sha1 = "foo", blobstore_id = "bar", compile_log_id = "baz" } };
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh.Test/XmlParsing.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Test
2 | {
3 | using System.Linq;
4 | using System.Xml;
5 | using System.Xml.Linq;
6 | using System.Xml.XPath;
7 | using IronFoundry.Bosh.Properties;
8 | using Xunit;
9 |
10 | public class XmlParsing
11 | {
12 | [Fact]
13 | public void Can_Modify_Unattend_XML_File()
14 | {
15 | string newValue = "BLARGH";
16 |
17 | string unattendXml = Resources.UnattendXML;
18 | var xdoc = XDocument.Parse(unattendXml);
19 | XNamespace ns = xdoc.Root.GetDefaultNamespace();
20 | XmlNamespaceManager nsMgr = new XmlNamespaceManager(new NameTable());
21 | nsMgr.AddNamespace("ns", ns.NamespaceName);
22 | var element = xdoc.XPathSelectElement(@"/ns:unattend/ns:settings/ns:component/ns:ComputerName", nsMgr);
23 | element.Value = newValue;
24 |
25 | var ele = xdoc.Descendants().Single(x => x.Name.LocalName == "ComputerName");
26 | Assert.Equal(newValue, ele.Value);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh.Test/iis-setup.tgz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Bosh.Test/iis-setup.tgz
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh.Test/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Agent/AgentException.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Agent
2 | {
3 | using System;
4 | using System.Runtime.Serialization;
5 |
6 | [Serializable]
7 | public class AgentException : Exception, ISerializable
8 | {
9 | public AgentException() { }
10 |
11 | public AgentException(string format, params object[] args)
12 | : this(String.Format(format, args)) { }
13 |
14 | public AgentException(string message)
15 | : base(message) { }
16 |
17 | public AgentException(string message, Exception inner)
18 | : base(message, inner) { }
19 |
20 | protected AgentException(SerializationInfo info, StreamingContext context)
21 | : base(info, context) { }
22 | }
23 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Agent/Handlers/BaseMessageHandler.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Agent.Handlers
2 | {
3 | using System;
4 | using IronFoundry.Bosh.Configuration;
5 | using Newtonsoft.Json.Linq;
6 |
7 | public abstract class BaseMessageHandler : IMessageHandler
8 | {
9 | private bool disposed = false;
10 | protected readonly IBoshConfig config;
11 |
12 | public BaseMessageHandler(IBoshConfig config)
13 | {
14 | this.config = config;
15 | }
16 |
17 | public abstract HandlerResponse Handle(JObject parsed);
18 |
19 | public virtual bool IsLongRunning
20 | {
21 | get { return false; }
22 | }
23 |
24 | public virtual void OnPostReply() { }
25 |
26 | public void Dispose()
27 | {
28 | if (false == disposed)
29 | {
30 | Dispose(true);
31 | GC.SuppressFinalize(this);
32 | disposed = true;
33 | }
34 | }
35 |
36 | protected virtual void Dispose(bool disposing) { }
37 | }
38 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Agent/Handlers/FetchLogs.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Agent.Handlers
2 | {
3 | using IronFoundry.Bosh.Configuration;
4 | using Newtonsoft.Json.Linq;
5 |
6 | public class FetchLogs : BaseMessageHandler
7 | {
8 | public FetchLogs(IBoshConfig config) : base(config) { }
9 |
10 | public override HandlerResponse Handle(JObject parsed)
11 | {
12 | return new HandlerResponse("TODO");
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Agent/Handlers/HandlerResponse.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Agent.Handlers
2 | {
3 | using System;
4 | using IronFoundry.Nats.Client;
5 | using Newtonsoft.Json;
6 |
7 | public class HandlerResponse : NatsMessage
8 | {
9 | private readonly object value;
10 |
11 | public HandlerResponse(object value)
12 | {
13 | if (null == value)
14 | {
15 | throw new ArgumentNullException("value");
16 | }
17 | this.value = value;
18 | }
19 |
20 | [JsonProperty(PropertyName="value")]
21 | public object Value { get { return value; } }
22 |
23 | public override string PublishSubject
24 | {
25 | get { return String.Empty; } // TODO Unused and ugly
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Agent/Handlers/IMessageHandler.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Agent.Handlers
2 | {
3 | using System;
4 | using Newtonsoft.Json.Linq;
5 |
6 | public interface IMessageHandler : IDisposable
7 | {
8 | bool IsLongRunning { get; }
9 | HandlerResponse Handle(JObject parsed);
10 | void OnPostReply();
11 | }
12 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Agent/Handlers/ListDisk.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Agent.Handlers
2 | {
3 | using IronFoundry.Bosh.Configuration;
4 | using Newtonsoft.Json.Linq;
5 |
6 | public class ListDisk : BaseMessageHandler
7 | {
8 | public ListDisk(IBoshConfig config) : base(config) { }
9 |
10 | public override HandlerResponse Handle(JObject parsed)
11 | {
12 | // agent/lib/agent/message/disk.rb
13 | return new HandlerResponse("TODO");
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Agent/Handlers/MigrateDisk.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Agent.Handlers
2 | {
3 | using IronFoundry.Bosh.Configuration;
4 | using Newtonsoft.Json.Linq;
5 |
6 | public class MigrateDisk : BaseMessageHandler
7 | {
8 | public MigrateDisk(IBoshConfig config) : base(config) { }
9 |
10 | public override HandlerResponse Handle(JObject parsed)
11 | {
12 | // agent/lib/agent/message/disk.rb
13 | return new HandlerResponse("TODO");
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Agent/Handlers/MountDisk.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Agent.Handlers
2 | {
3 | using IronFoundry.Bosh.Configuration;
4 | using Newtonsoft.Json.Linq;
5 |
6 | public class MountDisk : BaseMessageHandler
7 | {
8 | public MountDisk(IBoshConfig config) : base(config) { }
9 |
10 | public override HandlerResponse Handle(JObject parsed)
11 | {
12 | // agent/lib/agent/message/disk.rb
13 | return new HandlerResponse("TODO");
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Agent/Handlers/Noop.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Agent.Handlers
2 | {
3 | using IronFoundry.Bosh.Configuration;
4 | using Newtonsoft.Json.Linq;
5 |
6 | public class Noop : BaseMessageHandler
7 | {
8 | public Noop(IBoshConfig config) : base(config) { }
9 |
10 | public override HandlerResponse Handle(JObject parsed)
11 | {
12 | return new HandlerResponse("nope");
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Agent/Handlers/Ping.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Agent.Handlers
2 | {
3 | using IronFoundry.Bosh.Configuration;
4 | using Newtonsoft.Json.Linq;
5 |
6 | public class Ping : BaseMessageHandler
7 | {
8 | public Ping(IBoshConfig config) : base(config) { }
9 |
10 | public override HandlerResponse Handle(JObject parsed)
11 | {
12 | return new HandlerResponse("pong");
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Agent/Handlers/PrepareNetworkChange.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Agent.Handlers
2 | {
3 | using IronFoundry.Bosh.Configuration;
4 | using Newtonsoft.Json.Linq;
5 |
6 | public class PrepareNetworkChange : BaseMessageHandler
7 | {
8 | public PrepareNetworkChange(IBoshConfig config) : base(config) { }
9 |
10 | public override HandlerResponse Handle(JObject parsed)
11 | {
12 | return new HandlerResponse(true);
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Agent/Handlers/Shutdown.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Agent.Handlers
2 | {
3 | using IronFoundry.Bosh.Configuration;
4 | using Newtonsoft.Json.Linq;
5 |
6 | public class Shutdown : BaseMessageHandler
7 | {
8 | public Shutdown(IBoshConfig config) : base(config) { }
9 |
10 | public override HandlerResponse Handle(JObject parsed)
11 | {
12 | return new HandlerResponse("shutdown");
13 | }
14 |
15 | public override void OnPostReply()
16 | {
17 | // TODO do shutdown steps here
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Agent/Handlers/Ssh.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Agent.Handlers
2 | {
3 | using IronFoundry.Bosh.Configuration;
4 | using Newtonsoft.Json.Linq;
5 |
6 | public class Ssh : BaseMessageHandler
7 | {
8 | public Ssh(IBoshConfig config) : base(config) { }
9 |
10 | public override HandlerResponse Handle(JObject parsed)
11 | {
12 | return new HandlerResponse("TODO");
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Agent/Handlers/Start.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Agent.Handlers
2 | {
3 | using IronFoundry.Bosh.Configuration;
4 | using Newtonsoft.Json.Linq;
5 |
6 | public class Start : BaseMessageHandler
7 | {
8 | public Start(IBoshConfig config) : base(config) { }
9 |
10 | public override HandlerResponse Handle(JObject parsed)
11 | {
12 | // TODO: Monit.start_services
13 | // agent/lib/agent/handler.rb
14 | return new HandlerResponse("started");
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Agent/Handlers/State.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Agent.Handlers
2 | {
3 | using IronFoundry.Bosh.Configuration;
4 | using Newtonsoft.Json.Linq;
5 |
6 | public class State : BaseMessageHandler
7 | {
8 | public State(IBoshConfig config) : base(config) { }
9 |
10 | public override HandlerResponse Handle(JObject parsed)
11 | {
12 | // agent/lib/agent/monit.rb running, starting, failing or unknown
13 | var stateResult = new StateResult(config.AgentID, config.VM, "running", config.BoshProtocol);
14 | return new HandlerResponse(stateResult);
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Agent/Handlers/Stop.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Agent.Handlers
2 | {
3 | using IronFoundry.Bosh.Configuration;
4 | using Newtonsoft.Json.Linq;
5 |
6 | public class Stop : BaseMessageHandler
7 | {
8 | public Stop(IBoshConfig config) : base(config) { }
9 |
10 | public override HandlerResponse Handle(JObject parsed)
11 | {
12 | // TODO long_running? is true
13 | // agent/lib/agent/handler.rb 410
14 | // Monit.stop_services
15 | return new HandlerResponse("stopped");
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Agent/Handlers/UnmountDisk.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Agent.Handlers
2 | {
3 | using IronFoundry.Bosh.Configuration;
4 | using Newtonsoft.Json.Linq;
5 |
6 | public class UnmountDisk : BaseMessageHandler
7 | {
8 | public UnmountDisk(IBoshConfig config) : base(config) { }
9 |
10 | public override HandlerResponse Handle(JObject parsed)
11 | {
12 | // agent/lib/agent/message/disk.rb
13 | return new HandlerResponse(new { message = "Unmounted FOO on BAR TODO" });
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Agent/Handlers/UploadResult.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Agent.Handlers
2 | {
3 | using Newtonsoft.Json;
4 |
5 | public class UploadResult
6 | {
7 | private readonly string sha1;
8 | private readonly string blobstoreID;
9 | private readonly string compileLogID;
10 |
11 | public UploadResult(string sha1, string blobstoreID, string compileLogID)
12 | {
13 | this.sha1 = sha1;
14 | this.blobstoreID = blobstoreID;
15 | this.compileLogID = compileLogID;
16 | }
17 |
18 | [JsonProperty(PropertyName = "sha1")]
19 | public string SHA1 { get { return sha1; } }
20 |
21 | [JsonProperty(PropertyName = "blobstore_id")]
22 | public string BlobstoreID { get { return blobstoreID; } }
23 |
24 | [JsonProperty(PropertyName = "compile_log_id")]
25 | public string CompileLogID { get { return compileLogID; } }
26 | }
27 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Agent/MessageHandlerException.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Agent
2 | {
3 | using System;
4 | using System.Runtime.Serialization;
5 |
6 | [Serializable]
7 | public class MessageHandlerException : Exception, ISerializable
8 | {
9 | private readonly string blob;
10 |
11 | public MessageHandlerException() { }
12 |
13 | public MessageHandlerException(string message, string blob)
14 | : base(message)
15 | {
16 | this.blob = blob;
17 | }
18 |
19 | public MessageHandlerException(Exception inner)
20 | : base(null, inner) { }
21 |
22 | public MessageHandlerException(string message)
23 | : this(message, (Exception)null) { }
24 |
25 | public MessageHandlerException(string message, Exception inner)
26 | : base(message, inner) { }
27 |
28 | protected MessageHandlerException(SerializationInfo info, StreamingContext context)
29 | : base(info, context) { }
30 |
31 | public string Blob { get { return blob; } }
32 | }
33 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Agent/VMSetupState.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Agent
2 | {
3 | using Newtonsoft.Json;
4 |
5 | public class VMSetupState
6 | {
7 | [JsonProperty(PropertyName = "is_sysprepped")]
8 | public bool IsSysprepped { get; set; }
9 |
10 | [JsonProperty(PropertyName = "is_network_setup")]
11 | public bool IsNetworkSetup { get; set; }
12 | }
13 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Blobstore/BlobstoreClient.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Blobstore
2 | {
3 | using System;
4 |
5 | public abstract class BlobstoreClient : IBlobstoreClient
6 | {
7 | protected readonly BlobstoreOptions options;
8 |
9 | public BlobstoreClient(BlobstoreOptions options)
10 | {
11 | if (options == null)
12 | {
13 | throw new ArgumentNullException("options");
14 | }
15 | this.options = options;
16 | }
17 |
18 | public abstract string Create(string localFilePath);
19 | public abstract void Get(string blobstoreID, string localFilePath);
20 | public abstract void Delete(string blobstoreID);
21 | }
22 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Blobstore/BlobstoreException.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Blobstore
2 | {
3 | using System;
4 | using System.Runtime.Serialization;
5 |
6 | [Serializable]
7 | public class BlobstoreException : Exception, ISerializable
8 | {
9 | public BlobstoreException() { }
10 |
11 | public BlobstoreException(string format, params object[] args)
12 | : this(String.Format(format, args)) { }
13 |
14 | public BlobstoreException(string message)
15 | : base(message) { }
16 |
17 | public BlobstoreException(string message, Exception inner)
18 | : base(message, inner) { }
19 |
20 | protected BlobstoreException(SerializationInfo info, StreamingContext context)
21 | : base(info, context) { }
22 | }
23 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Blobstore/IBlobstoreClient.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Blobstore
2 | {
3 |
4 | public interface IBlobstoreClient
5 | {
6 | string Create(string localFilePath);
7 | void Delete(string blobstoreID);
8 | void Get(string blobstoreID, string localFilePath);
9 | }
10 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Blobstore/IBlobstoreClientFactory.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Blobstore
2 | {
3 | public interface IBlobstoreClientFactory
4 | {
5 | IBlobstoreClient Create();
6 | }
7 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Configuration/HeartbeatStateData.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Configuration
2 | {
3 | public class HeartbeatStateData
4 | {
5 | private readonly string job;
6 | private readonly ushort index;
7 | private readonly string jobState;
8 |
9 | public HeartbeatStateData(string job, ushort index, string jobState)
10 | {
11 | this.job = job;
12 | this.index = index;
13 | this.jobState = jobState;
14 | }
15 |
16 | public string Job { get { return job; } }
17 | public ushort Index { get { return index; } }
18 | public string JobState { get { return jobState; } }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Configuration/IBoshConfig.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Bosh.Configuration
2 | {
3 | using System;
4 | using IronFoundry.Bosh.Types;
5 | using Newtonsoft.Json.Linq;
6 |
7 | public interface IBoshConfig
8 | {
9 | #if DEBUG
10 | bool Debugging { get; }
11 | #endif
12 |
13 | string BaseDir { get; }
14 | string BoshBaseDir { get; }
15 | string SettingsFilePath { get; }
16 | string StateFilePath { get; }
17 |
18 | Uri Mbus { get; }
19 | string AgentID { get; }
20 |
21 | object VM { get; }
22 |
23 | string BlobstorePlugin { get; }
24 | Uri BlobstoreEndpoint { get; }
25 | string BlobstoreUser { get; }
26 | string BlobstorePassword { get; }
27 |
28 | void UpdateFrom(JObject settings);
29 |
30 | string BoshProtocol { get; }
31 |
32 | void SetState(Spec spec);
33 | HeartbeatStateData HeartbeatStateData { get; }
34 |
35 | TimeSpan HeartbeatInterval { get; }
36 | }
37 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | [assembly: AssemblyTitle("IronFoundry.Bosh")]
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/Settings.StyleCop:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/IronFoundry.Bosh/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/IronFoundry.CloudFoundryExplorer.Installer/Banner.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.CloudFoundryExplorer.Installer/Banner.bmp
--------------------------------------------------------------------------------
/src/IronFoundry.CloudFoundryExplorer.Installer/README_wixproj.txt:
--------------------------------------------------------------------------------
1 | Note:
2 |
3 | The wixproj file has been edited manually in ways that are not supported by the visual designer.
4 |
5 | is Platform-dependent.
6 |
7 | and are moved to the top-level since they should have the same values for all solution configurations.
8 |
--------------------------------------------------------------------------------
/src/IronFoundry.CloudFoundryExplorer.Installer/WelcomeBanner.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.CloudFoundryExplorer.Installer/WelcomeBanner.bmp
--------------------------------------------------------------------------------
/src/IronFoundry.CloudFoundryExplorer/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/IronFoundry.CloudFoundryExplorer/App.xaml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/IronFoundry.CloudFoundryExplorer/App.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.CloudFoundryExplorer
2 | {
3 | using IronFoundry.Ui.Controls.Model;
4 |
5 | public partial class App : System.Windows.Application
6 | {
7 | public App()
8 | {
9 | var preferencesProvider = new PreferencesProvider("CloudFoundryExplorerApp");
10 | var cloudFoundryProvider = new CloudFoundryProvider(preferencesProvider);
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/src/IronFoundry.CloudFoundryExplorer/CloudFoundrySmall.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.CloudFoundryExplorer/CloudFoundrySmall.ico
--------------------------------------------------------------------------------
/src/IronFoundry.CloudFoundryExplorer/IronFoundry.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.CloudFoundryExplorer/IronFoundry.snk
--------------------------------------------------------------------------------
/src/IronFoundry.CloudFoundryExplorer/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | [assembly: AssemblyTitle("IronFoundry.CloudFoundryExplorer")]
3 |
--------------------------------------------------------------------------------
/src/IronFoundry.CloudFoundryExplorer/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.CloudFoundryExplorer/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/IronFoundry.Dea.Service.Installer/Banner.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Dea.Service.Installer/Banner.bmp
--------------------------------------------------------------------------------
/src/IronFoundry.Dea.Service.Installer/README_wixproj.txt:
--------------------------------------------------------------------------------
1 | Note:
2 |
3 | The wixproj file has been edited manually in ways that are not supported by the visual designer.
4 |
5 | is Platform-dependent.
6 |
7 | and are moved to the top-level since they should have the same values for all solution configurations.
8 |
--------------------------------------------------------------------------------
/src/IronFoundry.Dea.Service.Installer/WelcomeBanner.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Dea.Service.Installer/WelcomeBanner.bmp
--------------------------------------------------------------------------------
/src/IronFoundry.Dea.Service.Installer/install.ps1:
--------------------------------------------------------------------------------
1 | # Example of a powershell installation file that will retrieve a local IP address to set
2 | # the LOCALROUTE property correctly
3 |
4 | $localIP = (Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=True -ComputerName . | ? { $_.IPAddress -ne $null }).IPAddress[0]
5 |
6 | Write-Host "Command: msiexec -ArgumentList '/q', '/i', 'IronFoundry.Dea.Service.x64.msi', '/l*v', 'install.log', 'NATSHOST=10.91.2.12', 'NATSPORT=4222', `"LOCALROUTE=$localIP`", 'INSTALLDIR=D:\IronFoundry\DEA', 'APPDIR=D:\IronFoundry\apps', 'DROPLETDIR=D:\IronFoundry\droplets'"
7 |
8 | Start-Process -Wait -FilePath msiexec -ArgumentList '/q', '/i', 'IronFoundry.Dea.Service.x64.msi', '/l*v', 'install.log', 'NATSHOST=10.91.2.12', 'NATSPORT=4222', "LOCALROUTE=$localIP", 'INSTALLDIR=D:\IronFoundry\DEA', 'APPDIR=D:\IronFoundry\apps', 'DROPLETDIR=D:\IronFoundry\droplets'
9 |
--------------------------------------------------------------------------------
/src/IronFoundry.Dea.Service/CloudFoundrySmall.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Dea.Service/CloudFoundrySmall.ico
--------------------------------------------------------------------------------
/src/IronFoundry.Dea.Service/IronFoundry.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Dea.Service/IronFoundry.snk
--------------------------------------------------------------------------------
/src/IronFoundry.Dea.Service/Program.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Service
2 | {
3 | using IronFoundry.Misc.WinService;
4 |
5 | static class Program
6 | {
7 | static void Main(string[] args)
8 | {
9 | ServiceMain.Start(args);
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea.Service/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | [assembly: AssemblyTitle("IronFoundry.Dea.Service")]
3 |
--------------------------------------------------------------------------------
/src/IronFoundry.Dea.Service/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Agent/IConfigManager.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Agent
2 | {
3 | using IronFoundry.Dea.Types;
4 |
5 | public interface IConfigManager
6 | {
7 | void BindServices(Droplet droplet, Instance instance);
8 | void SetupEnvironment(Droplet droplet, Instance instance);
9 | }
10 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Agent/IDropletManager.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Agent
2 | {
3 | using System;
4 | using System.Collections.Generic;
5 | using IronFoundry.Dea.Types;
6 |
7 | public interface IDropletManager
8 | {
9 | void Add(uint dropletID, Instance instance);
10 | void Add(uint dropletID, IEnumerable instances);
11 |
12 | void ForAllInstances(Action instanceAction);
13 | void ForAllInstances(Action dropletAction, Action instanceAction);
14 | void ForAllInstances(uint dropletID, Action instanceAction);
15 |
16 | void FromSnapshot(Snapshot snapshot);
17 | Snapshot GetSnapshot();
18 |
19 | void InstanceStopped(Instance instance);
20 |
21 | bool IsEmpty { get; }
22 |
23 | void SetProcessInformationFrom(IDictionary> iisWorkerProcesses);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Agent/IFilesManager.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Agent
2 | {
3 | using IronFoundry.Dea.Types;
4 |
5 | public interface IFilesManager
6 | {
7 | void CleanupInstanceDirectory(Instance instance);
8 | void CleanupInstanceDirectory(Instance instance, bool force);
9 |
10 | string GetApplicationPathFor(Instance instance);
11 |
12 | Snapshot GetSnapshot();
13 |
14 | string SnapshotFile { get; }
15 |
16 | bool Stage(Droplet droplet, Instance instance);
17 |
18 | void TakeSnapshot(Snapshot snapshot);
19 | }
20 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Configuration/IDeaConfig.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Configuration
2 | {
3 | using System;
4 | using System.Net;
5 |
6 | public interface IDeaConfig
7 | {
8 | ushort MaxMemoryMB { get; }
9 | bool DisableDirCleanup { get; }
10 | string DropletDir { get; }
11 | string AppDir { get; }
12 |
13 | IPAddress LocalIPAddress { get; }
14 |
15 | ushort FilesServicePort { get; }
16 | Uri FilesServiceUri { get; }
17 | ServiceCredential FilesCredentials { get; }
18 |
19 | ushort MonitoringServicePort { get; }
20 | Uri MonitoringServiceUri { get; }
21 | ServiceCredential MonitoringCredentials { get; }
22 | string MonitoringServiceHostStr { get; }
23 |
24 | string AppCmdPath { get; }
25 | bool HasAppCmd { get; }
26 | }
27 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Configuration/ServiceCredential.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Configuration
2 | {
3 | using System;
4 |
5 | public class ServiceCredential
6 | {
7 | private readonly string username;
8 | private readonly string password;
9 |
10 | public ServiceCredential()
11 | {
12 | this.username = getRandomCredential();
13 | this.password = getRandomCredential();
14 | }
15 |
16 | public string Username { get { return username; } }
17 |
18 | public string Password { get { return password; } }
19 |
20 | private string getRandomCredential()
21 | {
22 | return Guid.NewGuid().ToString().ToLowerInvariant().Replace("-", String.Empty);
23 | }
24 |
25 | public string[] ToArray()
26 | {
27 | return new[] { username, password };
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Extensions/DateTimeExtensionMethods.cs:
--------------------------------------------------------------------------------
1 | namespace System
2 | {
3 | public static class DateTimeExtensionMethods
4 | {
5 | private const string JsonDateFormat = "yyyy-MM-dd HH:mm:ss zz00";
6 |
7 | public static string ToJsonString(this DateTime argThis)
8 | {
9 | return argThis.ToString(JsonDateFormat);
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Extensions/FloatExtensionMethods.cs:
--------------------------------------------------------------------------------
1 | namespace System
2 | {
3 | public static class FloatExtensionMethods
4 | {
5 | public static float Truncate(this float argThis, int digits)
6 | {
7 | double mult = Math.Pow(10.0, digits);
8 | double result = Math.Truncate(mult * argThis) / mult;
9 | return (float)result;
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Extensions/TaskExtensionMethods.cs:
--------------------------------------------------------------------------------
1 | namespace System.Threading.Tasks
2 | {
3 | public static class TaskExtensionMethods
4 | {
5 | public static bool IsRunning(this Task argThis)
6 | {
7 | return TaskStatus.Running == argThis.Status;
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/IoC/DeaRegistry.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.IoC
2 | {
3 | using IronFoundry.Dea.Agent;
4 | using IronFoundry.Dea.Configuration;
5 | using IronFoundry.Dea.Providers;
6 | using IronFoundry.Misc.Agent;
7 | using StructureMap.Configuration.DSL;
8 |
9 | public class DeaRegistry : Registry
10 | {
11 | public DeaRegistry()
12 | {
13 | For().Use();
14 | For().Singleton().Use();
15 | For().Singleton().Use();
16 | For().Singleton().Use();
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/IronFoundry.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Dea/IronFoundry.snk
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | [assembly: AssemblyTitle("IronFoundry.Dea")]
3 |
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Providers/HealthzProvider.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Providers
2 | {
3 | using IronFoundry.Dea.Properties;
4 | using IronFoundry.Misc.Logging;
5 |
6 | public class HealthzProvider : IHealthzProvider
7 | {
8 | const string HealtzOK = "ok\n";
9 |
10 | private readonly ILog log;
11 |
12 | public HealthzProvider(ILog log)
13 | {
14 | this.log = log;
15 | }
16 |
17 | public string GetHealthz()
18 | {
19 | log.Debug(Resources.HealthzProvider_GetHealthzCalled_Message);
20 | return HealtzOK;
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Providers/IHealthzProvider.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Providers
2 | {
3 | public interface IHealthzProvider
4 | {
5 | string GetHealthz();
6 | }
7 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Providers/IVarzProvider.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Providers
2 | {
3 | using System.Collections.Generic;
4 | using IronFoundry.Dea.Types;
5 |
6 | public interface IVarzProvider
7 | {
8 | string GetVarzJson();
9 |
10 | VcapComponentDiscover Discover { set; }
11 |
12 | ulong MaxMemoryMB { set; }
13 | ulong MemoryReservedMB { set; }
14 | ulong MemoryUsedMB { set; }
15 | uint MaxClients { set; }
16 | string State { set; }
17 |
18 | IEnumerable RunningAppsJson { set; }
19 | IDictionary RuntimeMetrics { set; }
20 | IDictionary FrameworkMetrics { set; }
21 | }
22 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Providers/IWebOperationContextProvider.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Providers
2 | {
3 | using System;
4 | using System.IO;
5 | using System.Net;
6 | using System.ServiceModel.Channels;
7 |
8 | public interface IWebOperationContextProvider
9 | {
10 | Uri GetRequestUri();
11 | Message CreateStreamResponse(Stream stream, string contentType);
12 | void SetOutgoingResponse(HttpStatusCode code, string description);
13 |
14 | Message CreateTextResponse(string message, string contentType);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Providers/IWebServerAdministrationProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | namespace IronFoundry.Dea.Providers
3 | {
4 | public enum ApplicationInstanceStatus
5 | {
6 | Deleted,
7 | Started,
8 | Starting,
9 | Stopped,
10 | Stopping,
11 | Unknown
12 | }
13 |
14 | public class WebServerAdministrationBinding
15 | {
16 | public string Host;
17 | public ushort Port;
18 | }
19 |
20 | public interface IWebServerAdministrationProvider
21 | {
22 | WebServerAdministrationBinding InstallWebApp(
23 | string localDirectory, string applicationInstanceName, ushort managedRuntimeVersion);
24 | void UninstallWebApp(string applicationInstanceName);
25 | ApplicationInstanceStatus GetApplicationStatus(string applicationInstanceName);
26 | IDictionary> GetIIsWorkerProcesses();
27 | }
28 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Services/IFilesService.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Services
2 | {
3 | using System.ServiceModel;
4 | using System.ServiceModel.Channels;
5 | using System.ServiceModel.Web;
6 |
7 | [ServiceContract(Namespace=Constants.FilesServiceNamespace)]
8 | public interface IFilesService
9 | {
10 | [WebGet(UriTemplate = @"/*")]
11 | Message GetFile();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Services/IFirewallService.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Services
2 | {
3 | public interface IFirewallService
4 | {
5 | void Open(ushort port, string name);
6 | void Close(string name);
7 | }
8 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Services/IMonitoringService.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Services
2 | {
3 | using System.ServiceModel;
4 | using System.ServiceModel.Channels;
5 | using System.ServiceModel.Web;
6 |
7 | [ServiceContract(Namespace=Constants.MonitoringServiceNamespace)]
8 | public interface IMonitoringService
9 | {
10 | [WebGet(UriTemplate = "/healthz")]
11 | Message GetHealthz();
12 |
13 | [WebGet(UriTemplate = "/varz")]
14 | Message GetVarz();
15 | }
16 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Types/Discover.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Types
2 | {
3 | using Newtonsoft.Json;
4 |
5 | public class Discover : EntityBase
6 | {
7 | [JsonProperty(PropertyName = "droplet")]
8 | public uint DropletID { get; set; }
9 |
10 | [JsonProperty(PropertyName = "name")]
11 | public string Name { get; set; }
12 |
13 | [JsonProperty(PropertyName = "runtime")]
14 | public string Runtime { get; set; }
15 |
16 | [JsonProperty(PropertyName = "sha")]
17 | public string Sha { get; set; }
18 |
19 | [JsonProperty(PropertyName = "limits")]
20 | public Limits Limits { get; set; }
21 | }
22 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Types/DropletEntry.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Types
2 | {
3 | using Newtonsoft.Json;
4 |
5 | public class DropletEntry : EntityBase
6 | {
7 | [JsonProperty(PropertyName = "droplet")]
8 | public uint DropletID { get; set; }
9 |
10 | [JsonProperty(PropertyName = "instances")]
11 | public InstanceEntry[] Instances;
12 | }
13 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Types/DropletHeartbeat.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Types
2 | {
3 | using Newtonsoft.Json;
4 |
5 | public class DropletHeartbeat : Message
6 | {
7 | private const string publishSubject = "dea.heartbeat";
8 |
9 | [JsonIgnore]
10 | public override string PublishSubject
11 | {
12 | get { return publishSubject; }
13 | }
14 |
15 | [JsonProperty(PropertyName = "droplets")]
16 | public Heartbeat[] Droplets { get; set; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Types/FindDroplet.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Types
2 | {
3 | using System;
4 | using Newtonsoft.Json;
5 |
6 | public class FindDroplet : Message
7 | {
8 | [JsonProperty(PropertyName = "droplet")]
9 | public uint DropletID { get; set; }
10 |
11 | [JsonProperty(PropertyName = "version")]
12 | public string Version { get; set; }
13 |
14 | [JsonProperty(PropertyName = "instances")]
15 | public Guid[] InstanceIds { get; set; }
16 |
17 | [JsonProperty(PropertyName = "indices")]
18 | public uint[] Indices { get; set; }
19 |
20 | [JsonProperty(PropertyName = "states")]
21 | public string[] States { get; set; }
22 |
23 | [JsonProperty("include_stats")]
24 | public bool IncludeStats { get; set; }
25 | }
26 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Types/InstanceEntry.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Types
2 | {
3 | using System;
4 | using JsonConverters;
5 | using Newtonsoft.Json;
6 |
7 | public class InstanceEntry : EntityBase
8 | {
9 | [JsonProperty(PropertyName = "instance_id"), JsonConverter(typeof(VcapGuidConverter))]
10 | public Guid InstanceID { get; set; }
11 |
12 | [JsonProperty(PropertyName = "instance")]
13 | public Instance Instance { get; set; }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Types/Limits.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Types
2 | {
3 | using Newtonsoft.Json;
4 |
5 | public class Limits : EntityBase
6 | {
7 | [JsonProperty(PropertyName = "mem")]
8 | public uint MemoryMB { get; set; }
9 |
10 | [JsonProperty(PropertyName = "disk")]
11 | public uint DiskMB { get; set; }
12 |
13 | [JsonProperty(PropertyName = "fds")]
14 | public uint FDs { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Types/Message.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Types
2 | {
3 | using IronFoundry.Nats.Client;
4 | using Newtonsoft.Json;
5 |
6 | public abstract class Message : EntityBase, INatsMessage
7 | {
8 | public const string RECEIVE_ONLY = "RECEIVE_ONLY";
9 | public const string REPLY_OK = "REPLY_OK";
10 |
11 | [JsonIgnore]
12 | public virtual string PublishSubject
13 | {
14 | get { return RECEIVE_ONLY; }
15 | }
16 |
17 | [JsonIgnore]
18 | public bool IsReceiveOnly
19 | {
20 | get { return PublishSubject == RECEIVE_ONLY; } // TODO 201207
21 | }
22 |
23 | [JsonIgnore]
24 | public string RawJson { get; set; }
25 |
26 | public virtual bool CanPublishWithSubject(string subject)
27 | {
28 | return false;
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Types/Metric.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Types
2 | {
3 | using Newtonsoft.Json;
4 |
5 | public class Metric : EntityBase
6 | {
7 | public Metric()
8 | {
9 | UsedMemory = ReservedMemory = UsedDisk = UsedCpu = 0;
10 | }
11 |
12 | [JsonProperty(PropertyName="used_memory")]
13 | public ulong UsedMemory { get; set; }
14 |
15 | [JsonProperty(PropertyName="reserved_memory")]
16 | public ulong ReservedMemory { get; set; }
17 |
18 | [JsonProperty(PropertyName="used_disk")]
19 | public ulong UsedDisk { get; set; }
20 |
21 | [JsonProperty(PropertyName="used_cpu")]
22 | public ulong UsedCpu { get; set; }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Types/RouterRegister.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Types
2 | {
3 | using System;
4 | using JsonConverters;
5 | using Newtonsoft.Json;
6 |
7 | ///
8 | /// router.register
9 | ///
10 | public class RouterRegister : Message
11 | {
12 | private const string publishSubject = "router.register";
13 |
14 | [JsonIgnore]
15 | public override string PublishSubject
16 | {
17 | get { return publishSubject; }
18 | }
19 |
20 | [JsonProperty(PropertyName = "dea"), JsonConverter(typeof(VcapGuidConverter))]
21 | public Guid Dea { get; set; }
22 |
23 | [JsonProperty(PropertyName = "host")]
24 | public string Host { get; set; }
25 |
26 | [JsonProperty(PropertyName = "port")]
27 | public ushort Port { get; set; }
28 |
29 | [JsonProperty(PropertyName = "uris")]
30 | public string[] Uris { get; set; }
31 |
32 | [JsonProperty(PropertyName = "tags")] // TODO why tags plural?
33 | public Tag Tag { get; set; }
34 | }
35 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Types/RouterUnregister.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Types
2 | {
3 | using System;
4 | using JsonConverters;
5 | using Newtonsoft.Json;
6 |
7 | ///
8 | /// Used for router.unregister
9 | ///
10 | public class RouterUnregister : Message
11 | {
12 | private const string publishSubject = "router.unregister";
13 |
14 | [JsonIgnore]
15 | public override string PublishSubject
16 | {
17 | get { return publishSubject; }
18 | }
19 |
20 | [JsonProperty(PropertyName = "dea"), JsonConverter(typeof(VcapGuidConverter))]
21 | public Guid Dea { get; set; }
22 |
23 | [JsonProperty(PropertyName = "host")]
24 | public string Host { get; set; }
25 |
26 | [JsonProperty(PropertyName = "port")]
27 | public ushort Port { get; set; }
28 |
29 | [JsonProperty(PropertyName = "uris")]
30 | public string[] Uris { get; set; }
31 | }
32 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Types/Snapshot.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Types
2 | {
3 | using Newtonsoft.Json;
4 |
5 | public class Snapshot : EntityBase
6 | {
7 | [JsonProperty(PropertyName = "entries")]
8 | public DropletEntry[] Entries { get; set; }
9 | }
10 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Types/Status.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Types
2 | {
3 | using System;
4 | using Newtonsoft.Json;
5 |
6 | public class Status : Hello
7 | {
8 | [JsonProperty(PropertyName = "max_memory")]
9 | public uint MaxMemory { get; set; }
10 |
11 | [JsonProperty(PropertyName = "reserved_memory")]
12 | public uint ReservedMemory { get; set; }
13 |
14 | [JsonProperty(PropertyName = "used_memory")]
15 | public uint UsedMemory { get; set; }
16 |
17 | [JsonProperty(PropertyName = "num_clients")]
18 | public uint NumClients { get; set; }
19 |
20 | [JsonProperty(PropertyName = "state")]
21 | public string State { get; set; }
22 |
23 | public Status(Hello argHello)
24 | : base(argHello.ID, argHello.IPAddress, argHello.Port) { }
25 |
26 | public override bool CanPublishWithSubject(string subject)
27 | {
28 | return false == subject.IsNullOrWhiteSpace();
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Types/Tag.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Types
2 | {
3 | using Newtonsoft.Json;
4 |
5 | public class Tag
6 | {
7 | [JsonProperty(PropertyName = "framework")]
8 | public string Framework { get; set; }
9 |
10 | [JsonProperty(PropertyName = "runtime")]
11 | public string Runtime { get; set; }
12 | }
13 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Types/Usage.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Types
2 | {
3 | using System;
4 | using IronFoundry.Dea.JsonConverters;
5 | using Newtonsoft.Json;
6 |
7 | public class Usage : EntityBase
8 | {
9 | [JsonIgnore]
10 | public long TotalCpuTicks { get; set; }
11 |
12 | [JsonProperty(PropertyName="time"), JsonConverter(typeof(VcapDateTimeConverter))]
13 | public DateTime Time { get; set; }
14 |
15 | [JsonProperty(PropertyName="cpu")]
16 | public float Cpu { get; set; }
17 |
18 | [JsonProperty(PropertyName="mem")]
19 | public long MemoryUsageKB { get; set; }
20 |
21 | [JsonProperty(PropertyName="disk")]
22 | public long DiskUsageBytes { get; set; }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Types/VcapComponentAnnounce.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Types
2 | {
3 | using System;
4 | using IronFoundry.Dea.Configuration;
5 | using Newtonsoft.Json;
6 |
7 | public class VcapComponentAnnounce : VcapComponentBase
8 | {
9 | private const string publishSubject = "vcap.component.announce";
10 |
11 | public VcapComponentAnnounce(string type, string index, Guid uuid, string host, ServiceCredential credentials, DateTime start)
12 | : base(type, index, uuid, host, credentials, start) { }
13 |
14 | public VcapComponentAnnounce(VcapComponentBase vcapComponentBase) : base(vcapComponentBase) { }
15 |
16 | [JsonIgnore]
17 | public override string PublishSubject
18 | {
19 | get { return publishSubject; }
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Types/VcapResponse.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.Types
2 | {
3 | using Newtonsoft.Json;
4 |
5 | public class VcapResponse : EntityBase
6 | {
7 | [JsonProperty(PropertyName = "code")]
8 | public int Code
9 | {
10 | get; set;
11 | }
12 |
13 | [JsonProperty(PropertyName = "description")]
14 | public string Description
15 | {
16 | get; set;
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/Types/VcapStates.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea
2 | {
3 | public static class VcapStates
4 | {
5 | public const string STARTING = "STARTING";
6 | public const string STOPPED = "STOPPED";
7 | public const string RUNNING = "RUNNING";
8 | public const string STARTED = "STARTED";
9 | public const string SHUTTING_DOWN = "SHUTTING_DOWN";
10 | public const string CRASHED = "CRASHED";
11 | public const string DELETED = "DELETED";
12 |
13 | public static bool IsValid(string argState)
14 | {
15 | return STARTING == argState ||
16 | STOPPED == argState ||
17 | RUNNING == argState ||
18 | SHUTTING_DOWN == argState ||
19 | CRASHED == argState ||
20 | DELETED == argState;
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/WcfInfrastructure/IocServiceBehaviorUtil.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.WcfInfrastructure
2 | {
3 | using System.Collections.Generic;
4 | using System.ServiceModel;
5 |
6 | public static class IocServiceBehaviorUtil
7 | {
8 | public static void AddIoCServiceBehaviorTo(ServiceHost argServiceHost)
9 | {
10 | var behaviors = argServiceHost.Description.Behaviors;
11 |
12 | if (false == behaviors.IsNullOrEmpty())
13 | {
14 | var iocServiceBehavior = behaviors.Find();
15 | if (null == iocServiceBehavior)
16 | {
17 | iocServiceBehavior = new IocServiceBehavior();
18 | behaviors.Add(iocServiceBehavior);
19 | }
20 | }
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/WcfInfrastructure/IocServiceHost.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.WcfInfrastructure
2 | {
3 | using System;
4 |
5 | public class IocServiceHost : PerCallServiceHost
6 | {
7 | public IocServiceHost(Type serviceType) : base(serviceType) { }
8 |
9 | public IocServiceHost(Type serviceType, Uri baseAddress) : base(serviceType, baseAddress) { }
10 |
11 | protected override void OnOpening()
12 | {
13 | IocServiceBehaviorUtil.AddIoCServiceBehaviorTo(this);
14 | base.OnOpening();
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/WcfInfrastructure/PerCallServiceHost.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Dea.WcfInfrastructure
2 | {
3 | using System;
4 | using System.ServiceModel;
5 |
6 | public abstract class PerCallServiceHost : ServiceHost
7 | {
8 | public PerCallServiceHost(Type serviceType) : base(serviceType) { }
9 |
10 | public PerCallServiceHost(Type serviceType, Uri baseAddress) : base(serviceType, baseAddress) { }
11 |
12 | protected override void OnOpening()
13 | {
14 | var serviceBehavior = Description.Behaviors.Find();
15 | if (null == serviceBehavior)
16 | {
17 | serviceBehavior = new ServiceBehaviorAttribute();
18 | Description.Behaviors.Add(serviceBehavior);
19 | }
20 | serviceBehavior.InstanceContextMode = InstanceContextMode.PerCall;
21 |
22 | base.OnOpening();
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Dea/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Misc/Agent/IAgent.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Misc.Agent
2 | {
3 | public interface IAgent
4 | {
5 | string Name { get; }
6 | bool Error { get; }
7 | void Start();
8 | void Stop();
9 | string[] ProgramArguments { get; set; }
10 | }
11 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Misc/IronFoundry.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Misc/IronFoundry.snk
--------------------------------------------------------------------------------
/src/IronFoundry.Misc/Logging/ILog.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Misc.Logging
2 | {
3 | using System;
4 |
5 | public interface ILog
6 | {
7 | void Flush();
8 |
9 | void Debug(string message);
10 | void Debug(string fmt, params object[] args);
11 |
12 | void Error(string message);
13 | void Error(string fmt, params object[] args);
14 | void Error(Exception exception, string fmt, params object[] args);
15 | void Error(Exception exception);
16 |
17 | void Fatal(string message);
18 | void Fatal(string fmt, params object[] args);
19 |
20 | void Info(string message);
21 | void Info(string fmt, params object[] args);
22 |
23 | void Trace(string message);
24 | void Trace(string fmt, params object[] args);
25 |
26 | void Warn(string message);
27 | void Warn(string fmt, params object[] args);
28 |
29 | void EnableDebug();
30 | void DisableDebug();
31 |
32 | void AddFileTarget(string targetName, string logFilePath);
33 | }
34 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Misc/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | [assembly: AssemblyTitle("IronFoundry.Misc")]
--------------------------------------------------------------------------------
/src/IronFoundry.Misc/Utilities/DirectoryScope.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Misc.Utilities
2 | {
3 | using System;
4 | using System.IO;
5 |
6 | public class DirectoryScope : IDisposable
7 | {
8 | private readonly string oldCwd;
9 |
10 | public static DirectoryScope Create(string workingPath)
11 | {
12 | return new DirectoryScope(workingPath);
13 | }
14 |
15 | private DirectoryScope(string workingPath)
16 | {
17 | oldCwd = Directory.GetCurrentDirectory();
18 | Directory.SetCurrentDirectory(workingPath);
19 | }
20 |
21 | public void Dispose()
22 | {
23 | Directory.SetCurrentDirectory(oldCwd);
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Misc/Utilities/ExecCmdResult.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Misc.Utilities
2 | {
3 | using System;
4 |
5 | public class ExecCmdResult
6 | {
7 | private readonly bool success = false;
8 | private readonly string output = null;
9 |
10 | public ExecCmdResult(bool success, string output)
11 | {
12 | this.success = success;
13 | this.output = output;
14 | }
15 |
16 | public bool Success { get { return success; } }
17 | public string Output { get { return output; } }
18 |
19 | public override string ToString()
20 | {
21 | return String.Format("success: {0} output: {1}", success, output);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Misc/WinService/CustomCommands.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Misc.WinService
2 | {
3 | // Must be int between 128 and 255
4 | public enum CustomCommands : int
5 | {
6 | File_Logging_Enable_Debug = 128,
7 | File_Logging_Disable_Debug = 129,
8 | }
9 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Misc/WinService/IService.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Misc.WinService
2 | {
3 | using System;
4 |
5 | public interface IService
6 | {
7 | string ServiceName { get; }
8 | ushort StartIndex { get; }
9 | StartServiceResult StartService(IntPtr serviceHandle, string[] programArguments);
10 | void StopService();
11 | }
12 |
13 | public class StartServiceResult
14 | {
15 | private bool _success = true;
16 |
17 | public bool Success
18 | {
19 | get { return _success; }
20 | set { _success = value; }
21 | }
22 |
23 | public string Message { get; set; }
24 |
25 | public ushort ExitCode { get; set; }
26 | }
27 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Misc/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/IronFoundry.Nats/Client/Connect.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Nats.Client
2 | {
3 | using Newtonsoft.Json;
4 |
5 | public class Connect : NatsMessage
6 | {
7 | [JsonProperty(PropertyName = "verbose")]
8 | public bool Verbose { get; set; }
9 |
10 | [JsonProperty(PropertyName = "pedantic")]
11 | public bool Pedantic { get; set; }
12 |
13 | [JsonProperty(PropertyName = "user")]
14 | public string User { get; set; }
15 |
16 | [JsonProperty(PropertyName = "pass")]
17 | public string Password { get; set; }
18 |
19 | ///
20 | /// TODO 201207
21 | ///
22 | public override string PublishSubject
23 | {
24 | get { throw new System.NotImplementedException(); }
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Nats/Client/INatsClient.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Nats.Client
2 | {
3 | using System;
4 | using IronFoundry.Nats.Configuration;
5 |
6 | public interface INatsClient : IDisposable
7 | {
8 | Guid UniqueIdentifier { get; }
9 |
10 | void Publish(string message);
11 | void Publish(string subject, INatsMessage message);
12 | void Publish(NatsCommand argCommand, INatsMessage argMessage);
13 | void Publish(INatsMessage argMessage);
14 |
15 | void PublishReply(string replyTo, string json, uint delay);
16 | void PublishReply(string replyTo, INatsMessage message, uint delay);
17 |
18 | void Subscribe(INatsSubscription argSubscription, Action argCallback);
19 |
20 | void UseConfig(INatsConfig natsConfig);
21 | bool Start();
22 | void Stop();
23 | }
24 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Nats/Client/INatsMessage.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Nats.Client
2 | {
3 | public interface INatsMessage
4 | {
5 | string PublishSubject { get; }
6 | string ToJson();
7 | bool IsReceiveOnly { get; }
8 | bool CanPublishWithSubject(string subject);
9 | }
10 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Nats/Client/INatsSubscription.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Nats.Client
2 | {
3 | using System;
4 |
5 | public interface INatsSubscription : IEquatable
6 | {
7 | int SubscriptionID { get; } // TODO this should be part of the NATS client!
8 | string ToString();
9 | }
10 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Nats/Client/NatsMessage.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Nats.Client
2 | {
3 | using Newtonsoft.Json;
4 |
5 | public abstract class NatsMessage : INatsMessage
6 | {
7 | // TODO is this really useful?
8 | public virtual bool CanPublishWithSubject(string subject)
9 | {
10 | return true;
11 | }
12 |
13 | public string ToJson()
14 | {
15 | return JsonConvert.SerializeObject(this);
16 | }
17 |
18 | public override string ToString()
19 | {
20 | return ToJson();
21 | }
22 |
23 | [JsonIgnore]
24 | public abstract string PublishSubject { get; }
25 |
26 | [JsonIgnore]
27 | public bool IsReceiveOnly
28 | {
29 | get { return false; }
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Nats/Configuration/INatsConfig.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Nats.Configuration
2 | {
3 | public interface INatsConfig
4 | {
5 | string Host { get; }
6 | ushort Port { get; }
7 | string User { get; }
8 | string Password { get; }
9 | }
10 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Nats/Configuration/NatsConfig.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Nats.Configuration
2 | {
3 | using System.Configuration;
4 |
5 | public class NatsConfig : INatsConfig
6 | {
7 | private readonly NatsSection natsSection;
8 |
9 | public NatsConfig()
10 | {
11 | this.natsSection = (NatsSection)ConfigurationManager.GetSection(NatsSection.SectionName);
12 | }
13 |
14 | public string Host
15 | {
16 | get { return natsSection.Host; }
17 | }
18 |
19 | public ushort Port
20 | {
21 | get { return natsSection.Port; }
22 | }
23 |
24 | public string User
25 | {
26 | get { return natsSection.User; }
27 | }
28 |
29 | public string Password
30 | {
31 | get { return natsSection.Password; }
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Nats/IoC/NatsRegistry.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Nats.IoC
2 | {
3 | using IronFoundry.Nats.Configuration;
4 | using StructureMap.Configuration.DSL;
5 |
6 | public class NatsRegistry : Registry
7 | {
8 | public NatsRegistry()
9 | {
10 | For().Singleton().Use();
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Nats/IronFoundry.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Nats/IronFoundry.snk
--------------------------------------------------------------------------------
/src/IronFoundry.Nats/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | [assembly: AssemblyTitle("IronFoundry.Nats")]
--------------------------------------------------------------------------------
/src/IronFoundry.Nats/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/IronFoundry.Test/.gitignore:
--------------------------------------------------------------------------------
1 | !IronFoundry.Test.csproj.user
2 |
--------------------------------------------------------------------------------
/src/IronFoundry.Test/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/IronFoundry.Test/IronFoundry.Test.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Program
5 | test\xunit\xunit.gui.clr4.exe
6 | IronFoundry.Test.xunit
7 |
8 |
--------------------------------------------------------------------------------
/src/IronFoundry.Test/IronFoundry.Test.xunit:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Test/IronFoundry.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Test/IronFoundry.snk
--------------------------------------------------------------------------------
/src/IronFoundry.Test/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | [assembly: AssemblyTitle("IronFoundry.Test")]
3 |
--------------------------------------------------------------------------------
/src/IronFoundry.Test/TimerTests.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Test
2 | {
3 | using System;
4 | using System.Diagnostics;
5 | using System.Threading;
6 | using IronFoundry.Misc.Utilities;
7 | using Xunit;
8 |
9 | public class TimerTests
10 | {
11 | [Fact(Skip="MANUAL")]
12 | public void Test_One_Shot_Timer()
13 | {
14 | var timer = new ActionTimer(null, TimeSpan.FromMilliseconds(500), () => Debug.WriteLine("PING"));
15 | }
16 |
17 | [Fact(Skip="MANUAL")]
18 | public void Test_Recurring_Timer()
19 | {
20 | var timer = new ActionTimer(null, TimeSpan.FromSeconds(2), () => Debug.WriteLine("PING"), false, true);
21 | Thread.Sleep(TimeSpan.FromSeconds(30));
22 | timer.Dispose();
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/IronFoundry.Test/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/IronFoundry.Test/testapp.war:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Test/testapp.war
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/CloudFoundrySmall.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/CloudFoundrySmall.ico
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Converters/IsNullConverter.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Ui.Controls.Converters
2 | {
3 | using System;
4 | using System.Globalization;
5 | using System.Windows.Data;
6 |
7 | public class IsNullConverter : IValueConverter
8 | {
9 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
10 | {
11 | if (value == null)
12 | {
13 | return false;
14 | }
15 |
16 | if (!(value is bool))
17 | {
18 | return true;
19 | }
20 |
21 | return value;
22 | }
23 |
24 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
25 | {
26 | return value;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Converters/TitleCaseConverter.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Ui.Controls.Converters
2 | {
3 | using System;
4 | using System.Globalization;
5 | using System.Windows.Data;
6 |
7 | public class TitleCaseConverter : IValueConverter
8 | {
9 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
10 | {
11 | if (value == null)
12 | return String.Empty;
13 |
14 | var stringValue = value as string;
15 | stringValue = stringValue.ToLower();
16 | stringValue = culture.TextInfo.ToTitleCase(stringValue);
17 | return stringValue;
18 | }
19 |
20 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
21 | {
22 | throw new NotImplementedException();
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Images/CloudFoundrySmall.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Images/CloudFoundrySmall.ico
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Images/add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Images/add.png
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Images/add_cloud.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Images/add_cloud.png
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Images/apps.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Images/apps.png
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Images/appsadd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Images/appsadd.png
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Images/cloud_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Images/cloud_add.png
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Images/cloud_droplet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Images/cloud_droplet.png
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Images/cloud_foundry_eclipse_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Images/cloud_foundry_eclipse_icon.png
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Images/cloud_foundry_logo_400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Images/cloud_foundry_logo_400.png
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Images/cloud_play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Images/cloud_play.png
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Images/editurls.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Images/editurls.png
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Images/gear.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Images/gear.png
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Images/refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Images/refresh.png
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Images/server.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Images/server.png
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Images/serveradd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Images/serveradd.png
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Images/service.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Images/service.png
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Images/serviceadd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Images/serviceadd.png
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Images/start.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Images/start.png
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Images/stop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Images/stop.png
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Images/update.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Images/update.png
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/IronFoundry.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/IronFoundry.snk
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Model/CloudEventArgs.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Ui.Controls.Model
2 | {
3 | using System;
4 | using Models;
5 |
6 | public class CloudEventArgs : EventArgs
7 | {
8 | private readonly Cloud cloud;
9 |
10 | public CloudEventArgs(Cloud cloud)
11 | {
12 | this.cloud = cloud;
13 | }
14 |
15 | public Cloud Cloud { get { return cloud; } }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Model/CloudUpdate.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Ui.Controls.Model
2 | {
3 |
4 | using System;
5 | public class CloudUpdate
6 | {
7 | private readonly Guid id;
8 | private readonly string serverUrl;
9 | private readonly string serverName;
10 | private readonly string email;
11 | private readonly string password;
12 |
13 | public CloudUpdate(Guid id, string serverUrl, string serverName, string email, string password)
14 | {
15 | this.id = id;
16 | this.serverUrl = serverUrl;
17 | this.serverName = serverName;
18 | this.email = email;
19 | this.password = password;
20 | }
21 |
22 | public Guid ID { get { return id; } }
23 | public string ServerUrl { get { return serverUrl; } }
24 | public string ServerName { get { return serverName; } }
25 | public string Email { get { return email; } }
26 | public string Password { get { return password; } }
27 | }
28 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Model/IPreferencesProvider.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Ui.Controls.Model
2 | {
3 | using Models;
4 |
5 | public interface IPreferencesProvider
6 | {
7 | PreferencesV2 Load();
8 | void Save(PreferencesV2 preferences);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Model/ProviderResponse.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Ui.Controls.Model
2 | {
3 | using System;
4 |
5 | public class ProviderResponse
6 | {
7 | public T Response { get; set; }
8 | public string Message { get; set; }
9 |
10 | public ProviderResponse()
11 | {
12 | Response = default(T);
13 | Message = String.Empty;
14 | }
15 |
16 | public ProviderResponse(T response, string message)
17 | {
18 | Response = response;
19 | Message = message;
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Mvvm/IDragSource.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Ui.Controls.Mvvm
2 | {
3 | using System.Windows;
4 |
5 | public interface IDragSource
6 | {
7 | DragDropEffects GetDragEffects(object dataContext);
8 | object GetData(object dataContext);
9 | }
10 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Mvvm/IDropTarget.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Ui.Controls.Mvvm
2 | {
3 | using System.Windows;
4 |
5 | public interface IDropTarget
6 | {
7 | DragDropEffects GetDropEffects(IDataObject dataObject);
8 | void Drop(IDataObject dataObject);
9 | }
10 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Mvvm/ProgressError.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Ui.Controls.Mvvm
2 | {
3 | public class ProgressError
4 | {
5 | public ProgressError(string text)
6 | {
7 | this.Text = text;
8 | }
9 |
10 | public string Text { get; private set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Mvvm/ProgressMessage.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Ui.Controls.Mvvm
2 | {
3 | public class ProgressMessage
4 | {
5 | public ProgressMessage(int value, string text)
6 | {
7 | this.Value = value;
8 | this.Text = text;
9 | }
10 |
11 | public int Value { get; private set; }
12 | public string Text { get; private set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | [assembly: AssemblyTitle("IronFoundry.Ui.Controls")]
3 |
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/UserControls/ucSpinnerApple.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Ui.Controls.UserControls
2 | {
3 | using System.Windows.Controls;
4 |
5 | public partial class ucSpinnerApple : UserControl
6 | {
7 | public ucSpinnerApple()
8 | {
9 | this.InitializeComponent();
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/ViewModel/ViewModelBase.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Ui.Controls.ViewModel
2 | {
3 | public abstract class ViewModelBaseEx : GalaSoft.MvvmLight.ViewModelBase
4 | {
5 | protected bool SetValue(ref T originalValue, T newValue, string propertyName)
6 | {
7 | bool changed = false;
8 |
9 | if (ValuesAreDifferent(originalValue, newValue))
10 | {
11 | originalValue = newValue;
12 | RaisePropertyChanged(propertyName);
13 | changed = true;
14 | }
15 |
16 | return changed;
17 | }
18 |
19 | protected bool ValuesAreDifferent(T originalValue, T newValue)
20 | {
21 | return (ReferenceEquals(originalValue, null) && false == ReferenceEquals(newValue, null)) ||
22 | (false == ReferenceEquals(originalValue, null) && false == originalValue.Equals(newValue));
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Views/CloudView.xaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Views/CloudView.xaml
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Views/CreateService.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Ui.Controls.Views
2 | {
3 | using System.Windows;
4 | using GalaSoft.MvvmLight.Messaging;
5 | using Utilities;
6 | using ViewModel.Cloud;
7 |
8 | ///
9 | /// Interaction logic for ProvisionService.xaml
10 | ///
11 | public partial class CreateService : Window
12 | {
13 | public CreateService()
14 | {
15 | this.InitializeComponent();
16 | this.DataContext = new CreateServiceViewModel();
17 | this.Closed += (s, e) => Messenger.Default.Unregister(this);
18 |
19 | Messenger.Default.Register>(this,
20 | message =>
21 | {
22 | if (message.Notification.Equals(Messages.CreateServiceDialogResult))
23 | {
24 | this.DialogResult = message.Content;
25 | this.Close();
26 | Messenger.Default.Unregister(this);
27 | }
28 | });
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Views/Explorer.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Ui.Controls.Views
2 | {
3 | using System.Windows;
4 | using ViewModel;
5 |
6 | ///
7 | /// Interaction logic for MainWindow.xaml
8 | ///
9 | public partial class Explorer : Window
10 | {
11 | public Explorer()
12 | {
13 | InitializeComponent();
14 | this.DataContext = new ExplorerViewModel();
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Views/ProgressDialog.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Ui.Controls.Views
2 | {
3 | using System.Windows;
4 | using GalaSoft.MvvmLight.Messaging;
5 | using Utilities;
6 | using ViewModel;
7 |
8 | public partial class ProgressDialog : Window
9 | {
10 | public ProgressDialog()
11 | {
12 | InitializeComponent();
13 | this.DataContext = new ProgressViewModel();
14 | this.Closed += (s, e) => Messenger.Default.Unregister(this);
15 |
16 | Messenger.Default.Register>(this,
17 | message =>
18 | {
19 | if (message.Notification.Equals(Messages.ProgressDialogResult))
20 | {
21 | this.DialogResult = message.Content;
22 | this.Close();
23 | Messenger.Default.Unregister(this);
24 | }
25 | });
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Views/Push.xaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Views/Push.xaml
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/Views/Update.xaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Ui.Controls/Views/Update.xaml
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/IronFoundry.Ui.Controls/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/IronFoundry.VisualStudioExtension/Guids.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.VisualStudioExtension
2 | {
3 | using System;
4 |
5 | public static class GuidList
6 | {
7 | public const string guidCloudFoundryPkgString = "D11F588D-A83B-40C1-9637-A5F44B65D110";
8 | public const string guidCloudFoundryCmdSetString = "05F6013A-8190-4680-9122-69C726FBA0D9";
9 | public static readonly Guid guidCloudFoundryCmdSet = new Guid(guidCloudFoundryCmdSetString);
10 | };
11 | }
12 |
--------------------------------------------------------------------------------
/src/IronFoundry.VisualStudioExtension/IronFoundry.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.VisualStudioExtension/IronFoundry.snk
--------------------------------------------------------------------------------
/src/IronFoundry.VisualStudioExtension/PkgCmdID.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.VisualStudioExtension
2 | {
3 | public static class PkgCmdIDList
4 | {
5 | public const uint cmdidCloudFoundryExplorer = 0x100;
6 | public const uint cmdidPushCloudFoundryApplication = 0x200;
7 | public const uint cmdidUpdateCloudFoundryApplication = 0x300;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/IronFoundry.VisualStudioExtension/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | [assembly: AssemblyTitle("IronFoundry.VisualStudioExtension")]
3 |
--------------------------------------------------------------------------------
/src/IronFoundry.VisualStudioExtension/Resources/cloud_play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.VisualStudioExtension/Resources/cloud_play.png
--------------------------------------------------------------------------------
/src/IronFoundry.VisualStudioExtension/Resources/deploy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.VisualStudioExtension/Resources/deploy.png
--------------------------------------------------------------------------------
/src/IronFoundry.VisualStudioExtension/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/IronFoundry.VisualStudioExtension/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.IISHost/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | [assembly: AssemblyTitle("IronFoundry.Warden.IISHost")]
3 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.IISHost/Resources/aspnet.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.IISHost/Resources/redirection.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.IISHost/XmlExtensions.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.IISHost
2 | {
3 | using System.Xml.Linq;
4 | using System.Xml.XPath;
5 |
6 | public static class XmlExtensions
7 | {
8 | public static void SetValue(this XDocument root, string elementSelector, string attributeName, object attributeValue)
9 | {
10 | root.XPathSelectElement(elementSelector).SetAttributeValue(attributeName, attributeValue);
11 | }
12 |
13 | public static void AddToElement(this XDocument root, string elementSelector, object value)
14 | {
15 | root.XPathSelectElement(elementSelector).Add(value);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.IISHost/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Constants.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public static class Constants
4 | {
5 | public const byte CR = 0x0d;
6 | public const byte LF = 0x0a;
7 | public static readonly byte[] CRLF = new[] { CR, LF };
8 |
9 | public const string STDERR_NAME = "stderr";
10 | public const string STDOUT_NAME = "stdout";
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/IContainerRequest.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public interface IContainerRequest
4 | {
5 | string Handle { get; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/ITaskRequest.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public interface ITaskRequest : IContainerRequest
4 | {
5 | bool Privileged { get; }
6 | ResourceLimits Rlimits { get; }
7 | string Script { get; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/CopyInRequest.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class CopyInRequest : Request, ICopyRequest
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/CopyInResponse.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class CopyInResponse : Response
4 | {
5 | public override Message.Type ResponseType
6 | {
7 | get { return Message.Type.CopyIn; }
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/CopyOutRequest.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class CopyOutRequest : Request, ICopyRequest
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/CopyOutResponse.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class CopyOutResponse : Response
4 | {
5 | public override Message.Type ResponseType
6 | {
7 | get { return Message.Type.CopyOut; }
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/CreateRequest.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class CreateRequest : Request, IContainerRequest
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/CreateResponse.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class CreateResponse : Response
4 | {
5 | public override Message.Type ResponseType
6 | {
7 | get { return Message.Type.Create; }
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/DestroyRequest.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class DestroyRequest : Request, IContainerRequest
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/DestroyResponse.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class DestroyResponse : Response
4 | {
5 | public override Message.Type ResponseType
6 | {
7 | get { return Message.Type.Destroy; }
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/EchoRequest.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class EchoRequest : Request
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/EchoResponse.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class EchoResponse : Response
4 | {
5 | public override Message.Type ResponseType
6 | {
7 | get { return Warden.Protocol.Message.Type.Echo; }
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/ErrorResponse.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class ErrorResponse : Response
4 | {
5 | public override Message.Type ResponseType
6 | {
7 | get { return Warden.Protocol.Message.Type.Error; }
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/ICopyRequest.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public interface ICopyRequest : IContainerRequest
4 | {
5 | string SrcPath { get; }
6 | string DstPath { get; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/InfoRequest.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class InfoRequest : Request, IContainerRequest
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/LimitBandwidthRequest.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class LimitBandwidthRequest : Request
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/LimitBandwidthResponse.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class LimitBandwidthResponse : Response
4 | {
5 | public override Message.Type ResponseType
6 | {
7 | get { return Message.Type.LimitBandwidth; }
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/LimitDiskRequest.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class LimitDiskRequest : Request
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/LimitDiskResponse.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class LimitDiskResponse : Response
4 | {
5 | public override Message.Type ResponseType
6 | {
7 | get { return Message.Type.LimitDisk; }
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/LimitMemoryRequest.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class LimitMemoryRequest : Request
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/LimitMemoryResponse.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class LimitMemoryResponse : Response
4 | {
5 | public override Message.Type ResponseType
6 | {
7 | get { return Message.Type.LimitMemory; }
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/LinkRequest.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class LinkRequest : Request, IContainerRequest
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/LinkResponse.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class LinkResponse : Response
4 | {
5 | public override Message.Type ResponseType
6 | {
7 | get { return Message.Type.Link; }
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/ListRequest.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class ListRequest : Request
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/ListResponse.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class ListResponse : Response
4 | {
5 | public override Message.Type ResponseType
6 | {
7 | get { return Message.Type.List; }
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/NetInRequest.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class NetInRequest : Request, IContainerRequest
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/NetInResponse.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class NetInResponse : Response
4 | {
5 | public override Message.Type ResponseType
6 | {
7 | get { return Message.Type.NetIn; }
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/NetOutRequest.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class NetOutRequest : Request
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/NetOutResponse.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class NetOutResponse : Response
4 | {
5 | public override Message.Type ResponseType
6 | {
7 | get { return Message.Type.NetOut; }
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/PingRequest.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class PingRequest : Request
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/PingResponse.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class PingResponse : Response
4 | {
5 | public override Message.Type ResponseType
6 | {
7 | get { return Message.Type.Ping; }
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/ResourceLimits.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | using System;
4 |
5 | public partial class ResourceLimits
6 | {
7 | public long JobMemoryLimit
8 | {
9 | get
10 | {
11 | ulong tmp = Math.Max(this.Memlock, this.Data);
12 | tmp = Math.Max(tmp, this.Rss);
13 | return (long)tmp; // TODO overflow? unchecked?
14 | }
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/RunRequest.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class RunRequest : Request, ITaskRequest
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/RunResponse.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class RunResponse : Response
4 | {
5 | public override Message.Type ResponseType
6 | {
7 | get { return Message.Type.Run; }
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/SpawnRequest.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class SpawnRequest : Request, ITaskRequest
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/SpawnResponse.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class SpawnResponse : Response
4 | {
5 | public override Message.Type ResponseType
6 | {
7 | get { return Message.Type.Spawn; }
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/StopRequest.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class StopRequest : Request, IContainerRequest
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/StopResponse.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class StopResponse : Response
4 | {
5 | public override Message.Type ResponseType
6 | {
7 | get { return Message.Type.Stop; }
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Messages/StreamRequest.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public partial class StreamRequest : Request, IContainerRequest
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/ParseProto.ps1:
--------------------------------------------------------------------------------
1 | $proto_dir = '.\pb'
2 | $protogen_exe = Get-ChildItem -Recurse -Include protogen.exe | Select-Object -First 1 -ExpandProperty FullName
3 |
4 | if (!(Test-Path $protogen_exe))
5 | {
6 | Write-Error "Could not find 'protogen.exe', exiting."
7 | exit 1
8 | }
9 |
10 | if (!(Test-Path $proto_dir))
11 | {
12 | Write-Error "Directory '$proto_dir' containing *.proto files does not exist, exiting."
13 | exit 1
14 | }
15 |
16 | Push-Location -Verbose $proto_dir
17 |
18 | $protogen_args = @()
19 | $proto_files = Get-ChildItem -File -Filter '*.proto'
20 | foreach ($proto_file in $proto_files)
21 | {
22 | $in_name = $proto_file.Name
23 | $protogen_args += "-i:$in_name"
24 | }
25 |
26 | $protogen_output = & $protogen_exe -p:detectMissing -p:fixCase -q $protogen_args
27 |
28 | Pop-Location -Verbose
29 |
30 | Set-Content Messages.cs $protogen_output
31 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | [assembly: AssemblyTitle("IronFoundry.Warden.Protocol")]
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Request.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public abstract class Request
4 | {
5 | public override string ToString()
6 | {
7 | return this.GetType().ToString();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/Response.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | public abstract class Response
4 | {
5 | public abstract Message.Type ResponseType { get; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/ResponseWrapper.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Protocol
2 | {
3 | using System;
4 | using System.IO;
5 | using ProtoBuf;
6 |
7 | public class ResponseWrapper
8 | {
9 | private readonly Response response;
10 |
11 | public ResponseWrapper(Response response)
12 | {
13 | if (response == null)
14 | {
15 | throw new ArgumentNullException("response");
16 | }
17 | this.response = response;
18 | }
19 |
20 | public Message GetMessage()
21 | {
22 | byte[] msgPayload = null;
23 | using (var ms = new MemoryStream())
24 | {
25 | Serializer.Serialize(ms, this.response);
26 | msgPayload = ms.ToArray();
27 | }
28 | return new Message { MessageType = response.ResponseType, Payload = msgPayload };
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/pb/copy_in.proto:
--------------------------------------------------------------------------------
1 | // Copies files into a container.
2 | //
3 | // File permissions and symbolic links are be preserved, while hard links
4 | // are materialized. If the source path contains a trailing `/`, only the
5 | // contents of the directory will be copied. Otherwise, the outermost
6 | // directory, along with its contents, will be copied. The unprivileged
7 | // user inside the container is made owner of the resulting files.
8 | //
9 | // ### Request
10 | //
11 | // * `handle`: Container handle.
12 | // * `src_path`: Path on the host to copy from.
13 | // * `dst_path`: Path in the container to copy to.
14 | //
15 | // ### Response
16 | //
17 | // Empty.
18 | //
19 | // ### Errors
20 | //
21 | // > **TODO**
22 | //
23 | // ### Definition
24 | //
25 |
26 | package IronFoundry.Warden.Protocol;
27 | import "info.proto";
28 |
29 |
30 | message CopyInRequest {
31 | required string handle = 1;
32 | required string src_path = 2;
33 | required string dst_path = 3;
34 | }
35 |
36 | message CopyInResponse {
37 | }
38 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/pb/destroy.proto:
--------------------------------------------------------------------------------
1 | // Destroys a container.
2 | //
3 | // When a container is destroyed, its resource allocations are released,
4 | // its filesystem is removed, and all references to its handle are removed.
5 | //
6 | // All resources that have been acquired during the lifetime of the container are released.
7 | // Examples of these resources are its subnet, its UID, and ports that were redirected to the container.
8 | //
9 | // > **TODO** Link to list of resources that can be acquired during the lifetime of a container.
10 | //
11 | // ### Request
12 | //
13 | // * `handle`: Container handle.
14 | //
15 | // ### Response
16 | //
17 | // Empty.
18 | //
19 | // ### Errors
20 | //
21 | // * When `handle` does not refer to a container.
22 | //
23 | // ### Definition
24 | //
25 |
26 | package IronFoundry.Warden.Protocol;
27 | import "info.proto";
28 |
29 |
30 | message DestroyRequest {
31 | required string handle = 1;
32 | }
33 |
34 | message DestroyResponse {
35 | }
36 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/pb/echo.proto:
--------------------------------------------------------------------------------
1 | // Echoes a message.
2 | //
3 | // ### Request
4 | //
5 | // * `message`: Message to echo.
6 | //
7 | // ### Response
8 | //
9 | // * `message`: Echoed message.
10 | //
11 | // ### Errors
12 | //
13 | // None.
14 | //
15 | // ### Definition
16 | //
17 |
18 | package IronFoundry.Warden.Protocol;
19 | import "info.proto";
20 |
21 |
22 | message EchoRequest {
23 | required string message = 1;
24 | }
25 |
26 | message EchoResponse {
27 | required string message = 1;
28 | }
29 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/pb/error.proto:
--------------------------------------------------------------------------------
1 | // This is only a response.
2 | // If an error occurs while executing a request, it is captured and returned as an `ErrorResponse`.
3 | //
4 | // ### Response
5 | //
6 | // * `message`: Error message.
7 | // * `data`: Unused.
8 | // * `backtrace`: Unused.
9 | //
10 | // ### Definition
11 | //
12 |
13 | package IronFoundry.Warden.Protocol;
14 | import "info.proto";
15 |
16 |
17 | message ErrorResponse {
18 | optional string message = 2;
19 | optional string data = 4;
20 | repeated string backtrace = 3;
21 | }
22 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/pb/limit_bandwidth.proto:
--------------------------------------------------------------------------------
1 | // Limits the network bandwidth for a container.
2 | //
3 | // ### Request
4 | //
5 | // > **TODO**
6 | //
7 | // ### Response
8 | //
9 | // > **TODO**
10 | //
11 | // ### Errors
12 | //
13 | // > **TODO**
14 | //
15 | // ### Definition
16 | //
17 |
18 | package IronFoundry.Warden.Protocol;
19 | import "info.proto";
20 |
21 |
22 | message LimitBandwidthRequest {
23 | required string handle = 1;
24 |
25 | required uint64 rate = 2; // Bandwidth rate in byte(s)/sec
26 | required uint64 burst = 3; // Allow burst size in byte(s)
27 | }
28 |
29 | message LimitBandwidthResponse {
30 | required uint64 rate = 1; // Bandwidth rate in byte(s)/sec
31 | required uint64 burst = 2; // Allow burst size in byte(s)
32 | }
33 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/pb/limit_memory.proto:
--------------------------------------------------------------------------------
1 | // > **TODO** Link to page explaining how memory limits works.
2 | //
3 | // ### Request
4 | //
5 | // The field `limit_in_bytes` is optional.
6 | // When it is not specified, the memory usage limit will not be changed.
7 | // When it is specified, but not a multiple of the page size,
8 | // it is rounded up to the nearest multiple of the page size (the default page size is 4K).
9 | //
10 | // * `handle`: Container handle.
11 | // * `limit_in_bytes`: New memory usage limit in bytes.
12 | //
13 | // ### Response
14 | //
15 | // * `limit_in_bytes`: Memory usage limit in bytes.
16 | //
17 | // ### Errors
18 | //
19 | // > **TODO**
20 | //
21 | // ### Definition
22 | //
23 |
24 | package IronFoundry.Warden.Protocol;
25 | import "info.proto";
26 |
27 |
28 | message LimitMemoryRequest {
29 | required string handle = 1;
30 |
31 | optional uint64 limit_in_bytes = 2;
32 | }
33 |
34 | message LimitMemoryResponse {
35 | optional uint64 limit_in_bytes = 1;
36 | }
37 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/pb/link.proto:
--------------------------------------------------------------------------------
1 | // Link to a job.
2 | //
3 | // A request blocks until the job completes.
4 | // A job is removed after it has completed and has been linked to.
5 | //
6 | // > **TODO** Talk about nomenclature (what is a job).
7 | //
8 | // ### Request
9 | //
10 | // * `handle`: Container handle.
11 | // * `job_id`: Job ID.
12 | //
13 | // ### Response
14 | //
15 | // * `exit_status`: Exit status of the job.
16 | // * `stdout`: Standard out produced by the job.
17 | // * `stderr`: Standard error produced by the job.
18 | //
19 | // ### Errors
20 | //
21 | // * When `handle` does not refer to a container.
22 | // * When `job_id` does not refer to a job.
23 | //
24 | // ### Definition
25 | //
26 |
27 | package IronFoundry.Warden.Protocol;
28 | import "info.proto";
29 |
30 |
31 | message LinkRequest {
32 | required string handle = 1;
33 |
34 | required uint32 job_id = 2;
35 | }
36 |
37 | message LinkResponse {
38 | optional uint32 exit_status = 1;
39 | optional string stdout = 2;
40 | optional string stderr = 3;
41 | optional InfoResponse info = 4;
42 | }
43 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/pb/list.proto:
--------------------------------------------------------------------------------
1 | // Lists all containers.
2 | //
3 | // ### Request
4 | //
5 | // Empty.
6 | //
7 | // ### Response
8 | //
9 | // * `handles`: List of container handles.
10 | //
11 | // ### Errors
12 | //
13 | // None.
14 | //
15 | // ### Definition
16 | //
17 |
18 | package IronFoundry.Warden.Protocol;
19 | import "info.proto";
20 |
21 |
22 | message ListRequest {
23 | }
24 |
25 | message ListResponse {
26 | repeated string handles = 1;
27 | }
28 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/pb/message.proto:
--------------------------------------------------------------------------------
1 | // nodoc
2 |
3 | package IronFoundry.Warden.Protocol;
4 | import "info.proto";
5 |
6 |
7 | message Message {
8 | enum Type {
9 | Error = 1;
10 |
11 | Create = 11;
12 | Stop = 12;
13 | Destroy = 13;
14 | Info = 14;
15 |
16 | Spawn = 21;
17 | Link = 22;
18 | Run = 23;
19 | Stream = 24;
20 |
21 | NetIn = 31;
22 | NetOut = 32;
23 |
24 | CopyIn = 41;
25 | CopyOut = 42;
26 |
27 | LimitMemory = 51;
28 | LimitDisk = 52;
29 | LimitBandwidth = 53;
30 |
31 | Ping = 91;
32 | List = 92;
33 | Echo = 93;
34 | }
35 |
36 | required Type message_type = 1;
37 | required bytes payload = 2;
38 | }
39 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/pb/net_out.proto:
--------------------------------------------------------------------------------
1 | // Whitelist network traffic.
2 | //
3 | // If the configuration directive `deny_networks` is not used,
4 | // all networks are already whitelisted and this command is effectively a no-op.
5 | //
6 | // > **TODO** Link to page explaining how networking works.
7 | //
8 | // ### Request
9 | //
10 | // * `handle`: Container handle.
11 | // * `network`: Network to whitelist (in the form `1.2.3.4/8`).
12 | // * `port`: Port to whitelist.
13 | //
14 | // ### Response
15 | //
16 | // Empty.
17 | //
18 | // ### Errors
19 | //
20 | // * When `handle` does not refer to a container.
21 | //
22 | // ### Definition
23 | //
24 |
25 | package IronFoundry.Warden.Protocol;
26 | import "info.proto";
27 |
28 |
29 | message NetOutRequest {
30 | required string handle = 1;
31 |
32 | optional string network = 2;
33 | optional uint32 port = 3;
34 | }
35 |
36 | message NetOutResponse {
37 | }
38 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/pb/ping.proto:
--------------------------------------------------------------------------------
1 | // Pings.
2 | //
3 | // ### Request
4 | //
5 | // Empty.
6 | //
7 | // ### Response
8 | //
9 | // Empty.
10 | //
11 | // ### Errors
12 | //
13 | // None.
14 | //
15 | // ### Definition
16 | //
17 |
18 | package IronFoundry.Warden.Protocol;
19 | import "info.proto";
20 |
21 |
22 | message PingRequest {
23 | }
24 |
25 | message PingResponse {
26 | }
27 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/pb/run.proto:
--------------------------------------------------------------------------------
1 | // Run a job inside a container.
2 | //
3 | // This request is equivalent to spawning a job and immediately linking to it.
4 | //
5 | // See `Spawn` and `Link` for a description of the request and response.
6 | //
7 | // ### Errors
8 | //
9 | // * When `handle` does not refer to a container.
10 | //
11 | // ### Definition
12 | //
13 |
14 | package IronFoundry.Warden.Protocol;
15 | import "info.proto";
16 | import "resource_limits.proto";
17 |
18 |
19 | message RunRequest {
20 | required string handle = 1;
21 |
22 | required string script = 2;
23 | optional bool privileged = 3 [default = false];
24 | optional ResourceLimits rlimits = 4;
25 | }
26 |
27 | message RunResponse {
28 | optional uint32 exit_status = 1;
29 | optional string stdout = 2;
30 | optional string stderr = 3;
31 | optional InfoResponse info = 4;
32 | }
33 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/pb/spawn.proto:
--------------------------------------------------------------------------------
1 | // Spawn a job inside a container.
2 | //
3 | // > **TODO** Talk about nomenclature (what is a job).
4 | //
5 | // ### Request
6 | //
7 | // The specified script is interpreted by `/bin/bash` inside the container.
8 | //
9 | // * `handle`: Container handle.
10 | // * `script`: Script to execute.
11 | // * `privileged`: Whether to run the script as root or not.
12 | // * `rlimits`: Resource limits (see `ResourceLimits`).
13 | //
14 | // ### Response
15 | //
16 | // * `job_id`: Job ID.
17 | //
18 | // ### Errors
19 | //
20 | // * When `handle` does not refer to a container.
21 | //
22 | // ### Definition
23 | //
24 |
25 | package IronFoundry.Warden.Protocol;
26 | import "info.proto";
27 | import "resource_limits.proto";
28 |
29 |
30 | message SpawnRequest {
31 | required string handle = 1;
32 |
33 | required string script = 2;
34 | optional bool privileged = 3 [default = false];
35 | optional ResourceLimits rlimits = 4;
36 | }
37 |
38 | message SpawnResponse {
39 | required uint32 job_id = 1;
40 | }
41 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/tools/protogen/.gitignore:
--------------------------------------------------------------------------------
1 | !*.exe
2 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/tools/protogen/Licence.txt:
--------------------------------------------------------------------------------
1 | The core Protocol Buffers technology is provided courtesy of Google.
2 | At the time of writing, this is released under the BSD license.
3 | Full details can be found here:
4 |
5 | http://code.google.com/p/protobuf/
6 |
7 |
8 | This .NET implementation is Copyright 2008 Marc Gravell
9 |
10 | Licensed under the Apache License, Version 2.0 (the "License");
11 | you may not use this file except in compliance with the License.
12 | You may obtain a copy of the License at
13 |
14 | http://www.apache.org/licenses/LICENSE-2.0
15 |
16 | Unless required by applicable law or agreed to in writing, software
17 | distributed under the License is distributed on an "AS IS" BASIS,
18 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | See the License for the specific language governing permissions and
20 | limitations under the License.
21 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/tools/protogen/protobuf-net.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Warden.Protocol/tools/protogen/protobuf-net.dll
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/tools/protogen/protobuf-net.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Warden.Protocol/tools/protogen/protobuf-net.pdb
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/tools/protogen/protoc-license.txt:
--------------------------------------------------------------------------------
1 | Protocol Buffers - Google's data interchange format
2 | Copyright 2008 Google Inc.
3 | http://code.google.com/p/protobuf/
4 |
5 | This package contains a precompiled Win32 binary version of the protocol buffer
6 | compiler (protoc). This binary is intended for Windows users who want to
7 | use Protocol Buffers in Java or Python but do not want to compile protoc
8 | themselves. To install, simply place this binary somewhere in your PATH.
9 |
10 | This binary was built using MinGW, but the output is the same regardless of
11 | the C++ compiler used.
12 |
13 | You will still need to download the source code package in order to obtain the
14 | Java or Python runtime libraries. Get it from:
15 | http://code.google.com/p/protobuf/downloads/
16 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/tools/protogen/protogen.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Warden.Protocol/tools/protogen/protogen.exe
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/tools/protogen/protogen.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/tools/protogen/protogen.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Warden.Protocol/tools/protogen/protogen.pdb
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Protocol/tools/protogen/xml.xslt:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | Xml template for protobuf-net.
13 |
14 | This template writes the proto descriptor as xml.
15 | No options available.
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Service.Installer/Banner.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Warden.Service.Installer/Banner.bmp
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Service.Installer/WelcomeBanner.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Warden.Service.Installer/WelcomeBanner.bmp
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Service.InstallerCA/SessionLogger.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace IronFoundry.Warden.Service.InstallerCA
7 | {
8 | using Microsoft.Deployment.WindowsInstaller;
9 |
10 | public interface ILogger
11 | {
12 | void LogError(string message);
13 | void Log(string format, params object[] args);
14 | }
15 |
16 | public class SessionLogger : ILogger
17 | {
18 | private readonly Session session;
19 |
20 | public SessionLogger(Session session)
21 | {
22 | this.session = session;
23 | }
24 |
25 | public void LogError(string message)
26 | {
27 | session.Log(message);
28 | }
29 |
30 | public void Log(string formatMessage, params object[] args)
31 | {
32 | session.Log(formatMessage, args);
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Service/CloudFoundrySmall.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry.Warden.Service/CloudFoundrySmall.ico
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Service/Constants.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Service
2 | {
3 | public static class Constants
4 | {
5 | public const string DisplayName = "Iron Foundry Warden Service";
6 | public const string ServiceName = "ironfoundry.warden";
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Service/Program.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Service
2 | {
3 | using System;
4 | using System.IO;
5 | using NLog;
6 | using Topshelf;
7 |
8 | static class Program
9 | {
10 | static readonly Logger log = LogManager.GetCurrentClassLogger();
11 |
12 | static void Main(string[] args)
13 | {
14 | Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
15 |
16 | log.Info("Current directory is: '{0}'", Directory.GetCurrentDirectory());
17 |
18 | HostFactory.Run(x =>
19 | {
20 | x.Service();
21 | x.SetDescription(Constants.DisplayName);
22 | x.SetDisplayName(Constants.DisplayName);
23 | // NB: very important, must match installer
24 | x.SetServiceName(Constants.ServiceName);
25 | x.StartAutomaticallyDelayed();
26 | x.RunAsPrompt();
27 | x.UseNLog();
28 | });
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Service/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | [assembly: AssemblyTitle("IronFoundry.WardenService")]
3 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Service/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Test/ContainerHandleTests.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Test
2 | {
3 | using IronFoundry.Warden.Containers;
4 | using Xunit;
5 | using Xunit.Extensions;
6 |
7 | public class ContainerHandleTests
8 | {
9 | [Theory]
10 | [InlineData(1369422213166305, "16tfdq90d71")]
11 | [InlineData(1369422215826708, "16tfdqbhj8k")]
12 | [InlineData(1369422411336831, "16tfe06033v")]
13 | public void GivenInputData_GeneratesExpectedID(long input, string expectedID)
14 | {
15 | var handle = new ContainerHandle(input);
16 | Assert.Equal(expectedID, handle);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden.Test/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Configuration/WardenConfig.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Configuration
2 | {
3 | using System.Configuration;
4 |
5 | public class WardenConfig
6 | {
7 | private readonly WardenSection configSection;
8 |
9 | public WardenConfig()
10 | {
11 | this.configSection = (WardenSection)ConfigurationManager.GetSection(WardenSection.SectionName);
12 | }
13 |
14 | public string ContainerBasePath
15 | {
16 | get { return configSection.ContainerBasePath; }
17 | }
18 |
19 | public ushort TcpPort
20 | {
21 | get { return configSection.TcpPort; }
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Containers/IContainerManager.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Containers
2 | {
3 | using System;
4 | using System.Collections.Generic;
5 |
6 | public interface IContainerManager : IDisposable
7 | {
8 | void DestroyContainer(ContainerHandle handle);
9 | void DestroyContainer(Container container);
10 | void AddContainer(Container container);
11 | void RestoreContainers(string containerRoot);
12 | IEnumerable Handles { get; }
13 | Container GetContainer(string handle);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Containers/InfoBuilder.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Containers
2 | {
3 | using System;
4 | using Protocol;
5 | using Utilities;
6 |
7 | public class InfoBuilder
8 | {
9 | private readonly Container container;
10 |
11 | public InfoBuilder(Container container)
12 | {
13 | if (container == null)
14 | {
15 | throw new ArgumentNullException("container");
16 | }
17 | this.container = container;
18 | }
19 |
20 | public InfoResponse GetInfoResponse()
21 | {
22 | var hostIp = IPUtilities.GetLocalIPAddress().ToString();
23 | return new InfoResponse(hostIp, hostIp, container.Directory, container.State);
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Handlers/CopyInRequestHandler.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Handlers
2 | {
3 | using Containers;
4 | using Protocol;
5 |
6 | public class CopyInRequestHandler : CopyRequestHandler
7 | {
8 | public CopyInRequestHandler(IContainerManager containerManager, Request request)
9 | : base(containerManager, request, new CopyInResponse())
10 | {
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Handlers/CopyOutRequestHandler.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Handlers
2 | {
3 | using Containers;
4 | using Protocol;
5 |
6 | public class CopyOutRequestHandler : CopyRequestHandler
7 | {
8 | public CopyOutRequestHandler(IContainerManager containerManager, Request request)
9 | : base(containerManager, request, new CopyOutResponse())
10 | {
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Handlers/EchoRequestHandler.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Handlers
2 | {
3 | using System.Threading.Tasks;
4 | using IronFoundry.Warden.Protocol;
5 | using NLog;
6 |
7 | public class EchoRequestHandler : RequestHandler
8 | {
9 | private readonly Logger log = LogManager.GetCurrentClassLogger();
10 | private readonly EchoRequest request;
11 |
12 | public EchoRequestHandler(Request request)
13 | : base(request)
14 | {
15 | this.request = (EchoRequest)request;
16 | }
17 |
18 | public override Task HandleAsync()
19 | {
20 | log.Trace("Message: '{0}'", request.Message);
21 | return Task.FromResult(new EchoResponse { Message = request.Message });
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Handlers/IStreamingHandler.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Handlers
2 | {
3 | using System.Threading;
4 | using System.Threading.Tasks;
5 | using Protocol;
6 | using Utilities;
7 |
8 | public interface IStreamingHandler
9 | {
10 | Task HandleAsync(MessageWriter messageWriter, CancellationToken cancellationToken);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Handlers/InfoRequestHandler.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Handlers
2 | {
3 | using System.Threading.Tasks;
4 | using Containers;
5 | using NLog;
6 | using Protocol;
7 |
8 | public class InfoRequestHandler : ContainerRequestHandler
9 | {
10 | private readonly Logger log = LogManager.GetCurrentClassLogger();
11 | private readonly InfoRequest request;
12 |
13 | public InfoRequestHandler(IContainerManager containerManager, Request request)
14 | : base(containerManager, request)
15 | {
16 | this.request = (InfoRequest)request;
17 | }
18 |
19 | public override Task HandleAsync()
20 | {
21 | log.Trace("Handle: '{0}'", request.Handle);
22 | return Task.FromResult(BuildInfoResponse());
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Handlers/JobRequestHandler.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Handlers
2 | {
3 | using System;
4 | using Containers;
5 | using Jobs;
6 | using Protocol;
7 |
8 | public abstract class JobRequestHandler : ContainerRequestHandler
9 | {
10 | protected readonly IJobManager jobManager;
11 |
12 | public JobRequestHandler(IContainerManager containerManager, IJobManager jobManager, Request request)
13 | : base(containerManager, request)
14 | {
15 | if (jobManager == null)
16 | {
17 | throw new ArgumentNullException("jobManager");
18 | }
19 | this.jobManager = jobManager;
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Handlers/LimitBandwidthRequestHandler.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Handlers
2 | {
3 | using System.Threading.Tasks;
4 | using IronFoundry.Warden.Protocol;
5 | using NLog;
6 |
7 | public class LimitBandwidthRequestHandler : RequestHandler
8 | {
9 | private readonly Logger log = LogManager.GetCurrentClassLogger();
10 | private readonly LimitBandwidthRequest request;
11 |
12 | public LimitBandwidthRequestHandler(Request request)
13 | : base(request)
14 | {
15 | this.request = (LimitBandwidthRequest)request;
16 | }
17 |
18 | public override Task HandleAsync()
19 | {
20 | // TODO do work!
21 | log.Trace("Handle: '{0}' Burst: '{1}' Rate: '{2}'", request.Handle, request.Burst, request.Rate);
22 | return Task.FromResult(new LimitBandwidthResponse { Burst = 0, Rate = 0 });
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Handlers/LimitDiskRequestHandler.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Handlers
2 | {
3 | using System.Threading.Tasks;
4 | using IronFoundry.Warden.Protocol;
5 | using NLog;
6 |
7 | public class LimitDiskRequestHandler : RequestHandler
8 | {
9 | private readonly Logger log = LogManager.GetCurrentClassLogger();
10 | private readonly LimitDiskRequest request;
11 |
12 | public LimitDiskRequestHandler(Request request)
13 | : base(request)
14 | {
15 | this.request = (LimitDiskRequest)request;
16 | }
17 |
18 | public override Task HandleAsync()
19 | {
20 | // TODO do work!
21 | log.Trace("Handle: '{0}' Block: '{1}' Byte: '{2}' Inode: '{3}'", request.Handle, request.Block, request.Byte, request.Inode);
22 | return Task.FromResult(new LimitDiskResponse());
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Handlers/LimitMemoryRequestHandler.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Handlers
2 | {
3 | using System.Threading.Tasks;
4 | using IronFoundry.Warden.Protocol;
5 | using NLog;
6 |
7 | public class LimitMemoryRequestHandler : RequestHandler
8 | {
9 | private readonly Logger log = LogManager.GetCurrentClassLogger();
10 | private readonly LimitMemoryRequest request;
11 |
12 | public LimitMemoryRequestHandler(Request request)
13 | : base(request)
14 | {
15 | this.request = (LimitMemoryRequest)request;
16 | }
17 |
18 | public override Task HandleAsync()
19 | {
20 | // TODO do work!
21 | log.Trace("Handle: '{0}' LimitInBytes: '{1}'", request.Handle, request.LimitInBytes);
22 | return Task.FromResult(new LimitMemoryResponse { LimitInBytes = 134217728 }); // TODO 128 MB
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Handlers/NetOutRequestHandler.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Handlers
2 | {
3 | using System.Threading.Tasks;
4 | using IronFoundry.Warden.Protocol;
5 | using NLog;
6 |
7 | public class NetOutRequestHandler : RequestHandler
8 | {
9 | private readonly Logger log = LogManager.GetCurrentClassLogger();
10 | private readonly NetOutRequest request;
11 |
12 | public NetOutRequestHandler(Request request)
13 | : base(request)
14 | {
15 | this.request = (NetOutRequest)request;
16 | }
17 |
18 | public override Task HandleAsync()
19 | {
20 | // TODO do work!
21 | log.Trace("Handle: '{0}' Network: '{1}' Port: '{2}'", request.Handle, request.Network, request.Port);
22 | return Task.FromResult(new NetOutResponse());
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Handlers/PingRequestHandler.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Handlers
2 | {
3 | using System.Threading.Tasks;
4 | using IronFoundry.Warden.Protocol;
5 |
6 | public class PingRequestHandler : RequestHandler
7 | {
8 | private readonly PingRequest request;
9 |
10 | public PingRequestHandler(Request request)
11 | : base(request)
12 | {
13 | this.request = (PingRequest)request;
14 | }
15 |
16 | public override Task HandleAsync()
17 | {
18 | return Task.FromResult(new PingResponse());
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Handlers/ResponseData.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Handlers
2 | {
3 | public class ResponseData
4 | {
5 | private readonly int exitStatus;
6 | private readonly string message;
7 |
8 | public ResponseData(int exitStatus, string message)
9 | {
10 | this.exitStatus = exitStatus;
11 | this.message = message;
12 | }
13 |
14 | public int ExitStatus
15 | {
16 | get { return exitStatus; }
17 | }
18 |
19 | public string Message
20 | {
21 | get { return message; }
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Handlers/TaskRequestHandler.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Handlers
2 | {
3 | using System;
4 | using Containers;
5 | using Jobs;
6 | using Protocol;
7 | using Tasks;
8 |
9 | public abstract class TaskRequestHandler : ContainerRequestHandler
10 | {
11 | public TaskRequestHandler(IContainerManager containerManager, Request request)
12 | : base(containerManager, request)
13 | {
14 | }
15 |
16 | protected IJobRunnable GetRunnableFor(ITaskRequest request)
17 | {
18 | if (request == null)
19 | {
20 | throw new ArgumentNullException("request");
21 | }
22 |
23 | Container container = GetContainer();
24 | return new TaskRunner(container, request);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Jobs/IJobListener.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Jobs
2 | {
3 | using System.Threading.Tasks;
4 |
5 | public interface IJobListener
6 | {
7 | Task ListenStatusAsync(IJobStatus jobStatus);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Jobs/IJobManager.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Jobs
2 | {
3 | public interface IJobManager
4 | {
5 | uint StartJobFor(IJobRunnable runnable);
6 | Job GetJob(uint jobId);
7 | void RemoveJob(uint jobId);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Jobs/IJobResult.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Jobs
2 | {
3 | public interface IJobResult
4 | {
5 | int ExitCode { get; }
6 | string Stdout { get; }
7 | string Stderr { get; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Jobs/IJobRunnable.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Jobs
2 | {
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Threading.Tasks;
6 |
7 | public interface IJobRunnable
8 | {
9 | void Cancel();
10 |
11 | ///
12 | /// Runs job synchronously and all status/results will be in return value.
13 | ///
14 | ///
15 | IJobResult Run();
16 |
17 |
18 | ///
19 | /// Runs job asynchronously and all status/results will made available via the event.
20 | ///
21 | Task RunAsync();
22 | event EventHandler JobStatusAvailable;
23 |
24 | ///
25 | /// Dequeues and returns current set of un-observed status.
26 | ///
27 | IEnumerable RetrieveStatus();
28 | bool HasStatus { get; }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Jobs/IJobStatus.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Jobs
2 | {
3 | public enum JobDataSource
4 | {
5 | stdout,
6 | stderr
7 | }
8 |
9 | public interface IJobStatus
10 | {
11 | int? ExitStatus { get; }
12 | JobDataSource DataSource { get; }
13 | string Data { get; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Jobs/JobExceptionResult.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Jobs
2 | {
3 | using System;
4 |
5 | public class JobExceptionResult : IJobResult
6 | {
7 | private readonly string stderr;
8 |
9 | public JobExceptionResult(Exception ex)
10 | {
11 | this.stderr = ex.Message;
12 | }
13 |
14 | public int ExitCode
15 | {
16 | get { return 1; }
17 | }
18 |
19 | public string Stdout
20 | {
21 | get { return null; }
22 | }
23 |
24 | public string Stderr
25 | {
26 | get { return stderr; }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Jobs/JobStatusEventArgs.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Jobs
2 | {
3 | using System;
4 |
5 | public class JobStatusEventArgs : EventArgs
6 | {
7 | private readonly IJobStatus jobStatus;
8 |
9 | public JobStatusEventArgs(IJobStatus jobStatus)
10 | {
11 | if (jobStatus == null)
12 | {
13 | throw new ArgumentNullException("jobStatus");
14 | }
15 | this.jobStatus = jobStatus;
16 | }
17 |
18 | public IJobStatus JobStatus
19 | {
20 | get { return jobStatus; }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/PInvoke/CloseHandle.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.PInvoke
2 | {
3 | using System;
4 | using System.Runtime.InteropServices;
5 |
6 | internal partial class NativeMethods
7 | {
8 | [DllImport("kernel32.dll", SetLastError=true)]
9 | public static extern bool CloseHandle(IntPtr handle);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/PInvoke/DuplicateTokenEx.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.PInvoke
2 | {
3 | using System;
4 | using System.Runtime.InteropServices;
5 |
6 | internal partial class NativeMethods
7 | {
8 | [DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
9 | public static extern bool DuplicateTokenEx(
10 | IntPtr hExistingToken,
11 | uint dwDesiredAccess,
12 | SecurityAttributes lpTokenAttributes,
13 | SecurityImpersonationLevel impersonationLevel,
14 | TokenType tokenType,
15 | out IntPtr hNewToken);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/PInvoke/GetCurrentThreadId.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.PInvoke
2 | {
3 | using System.Runtime.InteropServices;
4 |
5 | internal partial class NativeMethods
6 | {
7 | [DllImport("kernel32.dll", SetLastError = true)]
8 | public static extern int GetCurrentThreadId();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/PInvoke/GetLengthSid.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.PInvoke
2 | {
3 | using System;
4 | using System.Runtime.InteropServices;
5 |
6 | internal partial class NativeMethods
7 | {
8 | [DllImport("advapi32.dll", SetLastError = true)]
9 | public static extern uint GetLengthSid(IntPtr pSid);
10 | }
11 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/PInvoke/GetProcessWindowStation.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.PInvoke
2 | {
3 | using System;
4 | using System.Runtime.InteropServices;
5 |
6 | internal partial class NativeMethods
7 | {
8 | [DllImport("user32.dll", SetLastError = true)]
9 | public static extern IntPtr GetProcessWindowStation();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/PInvoke/GetThreadDesktop.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.PInvoke
2 | {
3 | using System;
4 | using System.Runtime.InteropServices;
5 |
6 | internal partial class NativeMethods
7 | {
8 | [DllImport("user32.dll", SetLastError = true)]
9 | public static extern IntPtr GetThreadDesktop(int dwThreadId);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/PInvoke/LogonUser.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.PInvoke
2 | {
3 | using System;
4 | using System.Runtime.InteropServices;
5 |
6 | internal partial class NativeMethods
7 | {
8 | [DllImport("advapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
9 | public static extern Boolean LogonUser(
10 | String lpszUserName,
11 | String lpszDomain,
12 | String lpszPassword,
13 | LogonType dwLogonType,
14 | LogonProvider dwLogonProvider,
15 | out IntPtr phToken);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/PInvoke/LookupAccountSid.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.PInvoke
2 | {
3 | using System.Runtime.InteropServices;
4 | using System.Text;
5 |
6 | internal partial class NativeMethods
7 | {
8 | [DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
9 | public static extern bool LookupAccountSid(
10 | string lpSystemName,
11 | [MarshalAs(UnmanagedType.LPArray)] byte[] Sid,
12 | StringBuilder lpName,
13 | ref uint cchName,
14 | StringBuilder referencedDomainName,
15 | ref uint cchReferencedDomainName,
16 | out SidNameUse peUse);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/PInvoke/NativeMethods.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.PInvoke
2 | {
3 | using System.Security;
4 |
5 | [SuppressUnmanagedCodeSecurity]
6 | internal partial class NativeMethods
7 | {
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/PInvoke/OpenProcessToken.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.PInvoke
2 | {
3 | using System;
4 | using System.Runtime.InteropServices;
5 |
6 | internal partial class NativeMethods
7 | {
8 | [DllImport("advapi32.dll", SetLastError = true)]
9 | public static extern bool OpenProcessToken(IntPtr ProcessHandle, UInt32 DesiredAccess, out IntPtr TokenHandle);
10 | }
11 | }
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/PInvoke/RevertToSelf.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.PInvoke
2 | {
3 | using System.Runtime.InteropServices;
4 |
5 | internal partial class NativeMethods
6 | {
7 | [DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
8 | public static extern bool RevertToSelf();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/PInvoke/SafeUserTokenHandle.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.PInvoke
2 | {
3 | using System;
4 | using Microsoft.Win32.SafeHandles;
5 |
6 | internal sealed class SafeUserTokenHandle : SafeHandleZeroOrMinusOneIsInvalid
7 | {
8 | public SafeUserTokenHandle() : base(true)
9 | {
10 | }
11 |
12 | public SafeUserTokenHandle(IntPtr existingHandle) : base(true)
13 | {
14 | base.SetHandle(existingHandle);
15 | }
16 |
17 | public static explicit operator IntPtr(SafeUserTokenHandle userTokenHandle)
18 | {
19 | return userTokenHandle.DangerousGetHandle();
20 | }
21 |
22 | protected override bool ReleaseHandle()
23 | {
24 | return NativeMethods.CloseHandle(this.handle);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/PInvoke/SecurityAttributes.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.PInvoke
2 | {
3 | using System;
4 | using System.Runtime.InteropServices;
5 |
6 | internal partial class NativeMethods
7 | {
8 | [StructLayout(LayoutKind.Sequential)]
9 | public class SecurityAttributes
10 | {
11 | public Int32 Length;
12 | public IntPtr lpSecurityDescriptor;
13 | public bool bInheritHandle;
14 |
15 | public SecurityAttributes()
16 | {
17 | this.Length = Marshal.SizeOf(this);
18 | }
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/PInvoke/Structs.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.PInvoke
2 | {
3 | using System;
4 | using System.Runtime.InteropServices;
5 |
6 | internal partial class NativeMethods
7 | {
8 | [StructLayout(LayoutKind.Sequential)]
9 | public struct TokenUser
10 | {
11 | public SidAndAttributes User;
12 | }
13 |
14 | [StructLayout(LayoutKind.Sequential)]
15 | public struct SidAndAttributes
16 | {
17 | public IntPtr Sid;
18 | public int Attributes;
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | [assembly: AssemblyTitle("IronFoundry.Warden")]
3 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Tasks/MkdirCommand.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Tasks
2 | {
3 | using System;
4 | using System.Collections.Generic;
5 | using System.IO;
6 | using System.Text;
7 | using IronFoundry.Warden.Containers;
8 |
9 | public class MkdirCommand : PathCommand
10 | {
11 | public MkdirCommand(Container container, string[] arguments)
12 | : base(container, arguments)
13 | {
14 | if (base.arguments.IsNullOrEmpty())
15 | {
16 | throw new ArgumentException("mkdir command requires at least one argument.");
17 | }
18 | }
19 |
20 | protected override void ProcessPath(string path, StringBuilder output)
21 | {
22 | string pathInContainer = container.ConvertToPathWithin(path);
23 | Directory.CreateDirectory(pathInContainer);
24 | output.AppendFormat("mkdir: created directory '{0}'", pathInContainer).AppendLine();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Tasks/TaskCommand.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Tasks
2 | {
3 | using System;
4 | using IronFoundry.Warden.Containers;
5 |
6 | public abstract class TaskCommand
7 | {
8 | protected readonly Container container;
9 | protected readonly string[] arguments;
10 |
11 | public TaskCommand(Container container, string[] arguments)
12 | {
13 | if (container == null)
14 | {
15 | throw new ArgumentNullException("container");
16 | }
17 | this.container = container;
18 | this.arguments = arguments;
19 | }
20 |
21 | public abstract TaskCommandResult Execute();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Tasks/TaskCommandDTO.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Tasks
2 | {
3 | using Newtonsoft.Json;
4 |
5 | public class TaskCommandDTO
6 | {
7 | [JsonProperty(PropertyName="cmd")]
8 | public string Command { get; set; }
9 |
10 | [JsonProperty(PropertyName="args")]
11 | public string[] Args { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Tasks/TaskCommandResult.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Tasks
2 | {
3 | using IronFoundry.Warden.Jobs;
4 |
5 | public class TaskCommandResult : IJobResult
6 | {
7 | private readonly int exitCode;
8 | private readonly string stdout;
9 | private readonly string stderr;
10 |
11 | public TaskCommandResult(int exitCode, string stdout, string stderr)
12 | {
13 | this.exitCode = exitCode;
14 | this.stdout = stdout;
15 | this.stderr = stderr;
16 | }
17 |
18 | public int ExitCode
19 | {
20 | get { return exitCode; }
21 | }
22 |
23 | public string Stdout
24 | {
25 | get { return stdout; }
26 | }
27 |
28 | public string Stderr
29 | {
30 | get { return stderr; }
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Tasks/TaskCommandStatusEventArgs.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Tasks
2 | {
3 | using System;
4 |
5 | public class TaskCommandStatusEventArgs : EventArgs
6 | {
7 | private readonly TaskCommandStatus status;
8 |
9 | public TaskCommandStatusEventArgs(TaskCommandStatus status)
10 | {
11 | if (status == null)
12 | {
13 | throw new ArgumentNullException("status");
14 | }
15 | this.status = status;
16 | }
17 |
18 | public TaskCommandStatus Status
19 | {
20 | get { return status; }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Utilities/Impersonator.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Utilities
2 | {
3 | using System;
4 | using System.Net;
5 | using System.Security.Principal;
6 | using IronFoundry.Warden.PInvoke;
7 |
8 | public static class Impersonator
9 | {
10 | public static WindowsImpersonationContext GetContext(NetworkCredential credential, bool shouldImpersonate = false)
11 | {
12 | if (!shouldImpersonate)
13 | {
14 | return WindowsIdentity.GetCurrent().Impersonate();
15 | }
16 |
17 | using (var primaryToken = Utils.LogonAndGetUserPrimaryToken(credential))
18 | {
19 | return WindowsIdentity.Impersonate((IntPtr)primaryToken);
20 | }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Utilities/LocalPrincipalData.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Utilities
2 | {
3 | using System;
4 |
5 | public class LocalPrincipalData
6 | {
7 | private readonly string userName;
8 | private readonly string password;
9 |
10 | public LocalPrincipalData(string userName, string password)
11 | {
12 | if (userName.IsNullOrWhiteSpace())
13 | {
14 | throw new ArgumentNullException("userName");
15 | }
16 | this.userName = userName;
17 |
18 | if (password.IsNullOrWhiteSpace())
19 | {
20 | throw new ArgumentNullException("password");
21 | }
22 | this.password = password;
23 | }
24 |
25 | public string UserName
26 | {
27 | get { return userName; }
28 | }
29 |
30 | public string Password
31 | {
32 | get { return password; }
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/Utilities/LoggerExtensionMethods.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Warden.Utilities
2 | {
3 | using System;
4 | using NLog;
5 |
6 | public static class LoggerExtensionMethods
7 | {
8 | public static void DebugException(this Logger logger, Exception exception)
9 | {
10 | logger.LogException(LogLevel.Debug, String.Empty, exception);
11 | }
12 |
13 | public static void ErrorException(this Logger logger, Exception exception)
14 | {
15 | logger.LogException(LogLevel.Error, String.Empty, exception);
16 | }
17 |
18 | public static void WarnException(this Logger logger, Exception exception)
19 | {
20 | logger.LogException(LogLevel.Warn, String.Empty, exception);
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/IronFoundry.Warden/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/IronFoundry/Extensions/ObjectExtensionMethods.cs:
--------------------------------------------------------------------------------
1 | namespace System
2 | {
3 | using System.IO;
4 | using System.Runtime.Serialization.Formatters.Binary;
5 | using IronFoundry.Utilities;
6 |
7 | public static class ObjectExtensionMethods
8 | {
9 | public static T DeepCopy(this T obj)
10 | {
11 | Object result = null;
12 |
13 | using (var ms = new MemoryStream())
14 | {
15 | var formatter = new BinaryFormatter();
16 | formatter.Binder = new CustomSerializationBinder();
17 | formatter.Serialize(ms, obj);
18 | ms.Position = 0;
19 |
20 | result = (T)formatter.Deserialize(ms);
21 | ms.Close();
22 | }
23 |
24 | return (T)result;
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/IronFoundry/Extensions/UriExtensionMethods.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System;
5 |
6 | namespace IronFoundry.Extensions
7 | {
8 | public static class UriExtensionMethods
9 | {
10 | private static readonly char[] TrimChars = new char[] { '/' };
11 |
12 | public static string AbsoluteUriTrimmed(this Uri argThis)
13 | {
14 | return argThis.AbsoluteUri.TrimEnd(TrimChars);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/IronFoundry/IronFoundry.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/src/IronFoundry/IronFoundry.snk
--------------------------------------------------------------------------------
/src/IronFoundry/Models/AccessToken.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System;
5 |
6 | namespace IronFoundry.Models
7 | {
8 | using System;
9 |
10 | public class AccessToken
11 | {
12 | private readonly Uri uri;
13 | private string token;
14 |
15 | public AccessToken(Uri argUri, string argToken)
16 | {
17 | uri = argUri;
18 | token = argToken;
19 | }
20 |
21 | public AccessToken(string argUri, string argToken)
22 | {
23 | uri = new Uri(argUri);
24 | token = argToken;
25 | }
26 |
27 | public Uri Uri
28 | {
29 | get { return uri; }
30 | }
31 |
32 | public string Token
33 | {
34 | get { return token; }
35 | }
36 |
37 | public bool HasToken
38 | {
39 | get { return false == token.IsNullOrWhiteSpace(); }
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/IronFoundry/Models/AppServer.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System;
5 |
6 | namespace IronFoundry.Models
7 | {
8 | using System.Text;
9 | using System.Linq;
10 | using System.Collections.Generic;
11 | using System;
12 | using Newtonsoft.Json;
13 |
14 | public class AppServer : EntityBase
15 | {
16 | [JsonProperty(PropertyName = "name")]
17 | public string Name { get; private set; }
18 |
19 | [JsonProperty(PropertyName = "description")]
20 | public string Description { get; private set; }
21 | }
22 | }
--------------------------------------------------------------------------------
/src/IronFoundry/Models/Crash.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System;
5 |
6 | namespace IronFoundry.Models
7 | {
8 | using Newtonsoft.Json;
9 |
10 | public class Crash : EntityBase
11 | {
12 | [JsonProperty(PropertyName = "instance")]
13 | public string Instance { get; private set; }
14 |
15 | [JsonProperty(PropertyName = "since")]
16 | public int Since { get; private set; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/IronFoundry/Models/ExternalInstance.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System;
5 |
6 | namespace IronFoundry.Models
7 | {
8 | using System;
9 | using System.Collections.Generic;
10 | using System.Linq;
11 | using System.Text;
12 | using Newtonsoft.Json;
13 |
14 | public class ExternalInstance : EntityBase
15 | {
16 | [JsonProperty(PropertyName = "instances")]
17 | public InstanceDetail[] ExternInstance { get; set; }
18 | }
19 |
20 | public class InstanceDetail : EntityBase
21 | {
22 | [JsonProperty(PropertyName = "index")]
23 | public int Index { get; set; }
24 |
25 | [JsonProperty(PropertyName = "state")]
26 | public string State { get; set; }
27 |
28 | [JsonProperty(PropertyName = "since")]
29 | public int Since { get; set; }
30 |
31 | [JsonProperty(PropertyName = "debug_port")]
32 | public string DebugPort { get; set; }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/IronFoundry/Models/Framework.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System;
5 |
6 | namespace IronFoundry.Models
7 | {
8 | using Newtonsoft.Json;
9 |
10 | public class Framework :EntityBase
11 | {
12 | [JsonProperty(PropertyName = "name")]
13 | public string Name { get; private set; }
14 |
15 | [JsonProperty(PropertyName = "runtimes")]
16 | public Runtime[] Runtimes { get; private set; }
17 |
18 | [JsonProperty(PropertyName="appservers")]
19 | public AppServer[] AppServers { get; private set; }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/IronFoundry/Models/IMergeable.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System;
5 |
6 | namespace IronFoundry.Models
7 | {
8 | public interface IMergeable
9 | {
10 | void Merge(T obj);
11 | }
12 | }
--------------------------------------------------------------------------------
/src/IronFoundry/Models/InfoLimits.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System;
5 |
6 | namespace IronFoundry.Models
7 | {
8 | using Newtonsoft.Json;
9 |
10 | public class InfoLimits : EntityBase
11 | {
12 | [JsonProperty(PropertyName = "memory")]
13 | public uint Memory { get; private set; }
14 |
15 | [JsonProperty(PropertyName = "app_uris")]
16 | public uint AppURIs { get; private set; }
17 |
18 | [JsonProperty(PropertyName = "services")]
19 | public uint Services { get; private set; }
20 |
21 | [JsonProperty(PropertyName = "apps")]
22 | public uint Apps { get; private set; }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/IronFoundry/Models/InfoUsage.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System;
5 |
6 | namespace IronFoundry.Models
7 | {
8 | using Newtonsoft.Json;
9 |
10 | public class InfoUsage : EntityBase
11 | {
12 | [JsonProperty(PropertyName = "memory")]
13 | public uint Memory { get; private set; }
14 |
15 | [JsonProperty(PropertyName = "apps")]
16 | public uint Apps { get; private set; }
17 |
18 | [JsonProperty(PropertyName = "services")]
19 | public uint Services { get; private set; }
20 | }
21 | }
--------------------------------------------------------------------------------
/src/IronFoundry/Models/Limits.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System;
5 |
6 | namespace IronFoundry.Models
7 | {
8 | using Newtonsoft.Json;
9 |
10 | public class Limits : EntityBase
11 | {
12 | [JsonProperty(PropertyName = "mem")]
13 | public int Mem { get; set; }
14 |
15 | [JsonProperty(PropertyName = "disk")]
16 | public int Disk { get; set; }
17 |
18 | [JsonProperty(PropertyName = "fds")]
19 | public int FDs { get; set; }
20 | }
21 | }
--------------------------------------------------------------------------------
/src/IronFoundry/Models/Message.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System;
5 |
6 | namespace IronFoundry.Models
7 | {
8 | using Newtonsoft.Json;
9 |
10 | public abstract class Message : EntityBase
11 | {
12 | public const string ReceiveOnly = "RECEIVE_ONLY";
13 | public const string ReplyOk = "REPLY_OK";
14 |
15 | [JsonIgnore]
16 | public virtual string PublishSubject
17 | {
18 | get { return ReceiveOnly; }
19 | }
20 |
21 | [JsonIgnore]
22 | public string RawJson { get; set; }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/IronFoundry/Models/PreferencesV2.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System;
5 |
6 | namespace IronFoundry.Models
7 | {
8 | using System;
9 |
10 | [Serializable]
11 | public class PreferencesV2
12 | {
13 | private Cloud[] clouds;
14 |
15 | public Cloud[] Clouds
16 | {
17 | get { return this.clouds; }
18 | set
19 | {
20 | this.clouds = value.DeepCopy();
21 | foreach (Cloud cloud in this.clouds)
22 | {
23 | cloud.Services.Clear();
24 | cloud.Applications.Clear();
25 | cloud.AvailableServices.Clear();
26 | cloud.IsConnected = false;
27 | cloud.IsDisconnected = true;
28 | }
29 | }
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/src/IronFoundry/Models/Runtime.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System;
5 |
6 | namespace IronFoundry.Models
7 | {
8 | using System.Text;
9 | using System.Linq;
10 | using System.Collections.Generic;
11 | using System;
12 | using Newtonsoft.Json;
13 |
14 | public class Runtime : EntityBase
15 | {
16 | [JsonProperty(PropertyName = "name")]
17 | public string Name { get; private set; }
18 |
19 | [JsonProperty(PropertyName = "version")]
20 | public string Version { get; private set; }
21 |
22 | [JsonProperty(PropertyName = "description")]
23 | public string Description { get; private set; }
24 | }
25 | }
--------------------------------------------------------------------------------
/src/IronFoundry/Models/StatInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System;
5 |
6 | namespace IronFoundry.Models
7 | {
8 | using Newtonsoft.Json;
9 |
10 | public class StatInfo : EntityBase
11 | {
12 | [JsonProperty(PropertyName = "state")]
13 | public string State { get; set; }
14 |
15 | [JsonProperty(PropertyName = "stats")]
16 | public Stats Stats { get; set; }
17 |
18 | [JsonIgnore]
19 | public int ID { get; set; }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/IronFoundry/Models/SystemServiceEqualityComparer.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System;
5 |
6 | namespace IronFoundry.Models
7 | {
8 | public class SystemServiceEqualityComparer : IEqualityComparer
9 | {
10 | public bool Equals(SystemService c1, SystemService c2)
11 | {
12 | return c1.Vendor.Equals(c2.Vendor);
13 | }
14 |
15 | public int GetHashCode(SystemService c)
16 | {
17 | return c.Vendor.GetHashCode();
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/IronFoundry/Models/Usage.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System;
5 |
6 | namespace IronFoundry.Models
7 | {
8 | using System;
9 | using Newtonsoft.Json;
10 |
11 | public class Usage
12 | {
13 | [JsonProperty(PropertyName="time")]
14 | public DateTime CurrentTime { get; set; }
15 |
16 | [JsonProperty(PropertyName="cpu")]
17 | public float CpuTime { get; set; }
18 |
19 | [JsonProperty(PropertyName="mem")]
20 | public float MemoryUsage { get; set; }
21 |
22 | [JsonProperty(PropertyName="disk")]
23 | public float DiskUsage { get; set; }
24 | }
25 | }
--------------------------------------------------------------------------------
/src/IronFoundry/Models/VcapResponse.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System;
5 |
6 | namespace IronFoundry.Models
7 | {
8 | using Newtonsoft.Json;
9 |
10 | public class VcapResponse : EntityBase
11 | {
12 | [JsonProperty(PropertyName = "code")]
13 | public int Code
14 | {
15 | get; set;
16 | }
17 |
18 | [JsonProperty(PropertyName = "description")]
19 | public string Description
20 | {
21 | get; set;
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/IronFoundry/Models/VcapUser.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System;
5 |
6 | namespace IronFoundry.Models
7 | {
8 | using System;
9 | using Newtonsoft.Json;
10 |
11 | [Serializable]
12 | public class VcapUser
13 | {
14 | [JsonProperty(PropertyName = "email")]
15 | public string Email { get; set; }
16 |
17 | [JsonProperty(PropertyName = "admin")]
18 | public bool Admin { get; set; }
19 |
20 | [JsonProperty(PropertyName = "apps")]
21 | public VcapUserApp[] Apps { get; set; }
22 | }
23 | }
--------------------------------------------------------------------------------
/src/IronFoundry/Models/VcapUserApp.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System;
5 |
6 | namespace IronFoundry.Models
7 | {
8 | using Newtonsoft.Json;
9 |
10 | public class VcapUserApp
11 | {
12 | [JsonProperty(PropertyName = "name")]
13 | public string Name { get; set; }
14 |
15 | [JsonProperty(PropertyName = "state")]
16 | public string State { get; set; }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/IronFoundry/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | [assembly: AssemblyTitle("IronFoundry")]
4 |
--------------------------------------------------------------------------------
/src/IronFoundry/Utilities/Constants.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Utilities
2 | {
3 | public static class Constants
4 | {
5 | public static int[] MemoryLimits = new int[6] { 64, 128, 256, 512, 1024, 2048 };
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/IronFoundry/Utilities/NewtonsoftJsonDeserializer.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Utilities
2 | {
3 | using Newtonsoft.Json;
4 | using RestSharp;
5 | using RestSharp.Deserializers;
6 |
7 | public class NewtonsoftJsonDeserializer : IDeserializer
8 | {
9 | public const string JsonContentType = "application/json";
10 |
11 | public T Deserialize(IRestResponse response)
12 | {
13 | return JsonConvert.DeserializeObject(response.Content);
14 | }
15 |
16 | public string DateFormat { get; set; }
17 |
18 | public string Namespace { get; set; }
19 |
20 | public string RootElement { get; set; }
21 |
22 | public string ContentType
23 | {
24 | get { return JsonContentType; }
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/src/IronFoundry/Utilities/Utilities.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry
2 | {
3 | using System.IO;
4 | using Microsoft.VisualBasic.Devices;
5 |
6 | public static class Utility
7 | {
8 | public static void CopyDirectory(DirectoryInfo source, DirectoryInfo target)
9 | {
10 | var c = new Computer();
11 | c.FileSystem.CopyDirectory(source.FullName, target.FullName, true);
12 | }
13 |
14 | public static DirectoryInfo GetTempDirectory()
15 | {
16 | return Directory.CreateDirectory(
17 | Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()));
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/IronFoundry/Vcap/Constants.cs:
--------------------------------------------------------------------------------
1 | namespace IronFoundry.Vcap
2 | {
3 | using System;
4 |
5 | public class Constants
6 | {
7 | public static readonly Uri DEFAULT_TARGET = new Uri("http://api.cloudfoundry.com");
8 | public static readonly Uri DEFAULT_LOCAL_TARGET = new Uri("http://api.vcap.me");
9 |
10 | // General Paths
11 | public const string INFO_PATH = "/info";
12 | public const string GLOBAL_SERVICES_PATH = "/info/services";
13 | public const string RESOURCES_PATH = "/resources";
14 |
15 | // User specific paths
16 | public const string APPS_PATH = "/apps";
17 | public const string SERVICES_PATH = "/services";
18 | public const string USERS_PATH = "/users";
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/IronFoundry/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/shared/CommonAssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | // This code was generated by a tool. Changes will be lost.
2 | using System.Reflection;
3 | [assembly: AssemblyCompany("Tier 3, Inc.")]
4 | [assembly: AssemblyCopyright("Copyright © Tier 3, Inc. All rights reserved.")]
5 | [assembly: AssemblyProduct("Iron Foundry")]
6 | [assembly: AssemblyVersion("2.0.0.0")]
7 | [assembly: AssemblyFileVersion("2.0.0.0")]
8 | [assembly: AssemblyInformationalVersion("DevLocal")]
9 |
--------------------------------------------------------------------------------
/src/wixshared/IronFoundryShared.wxi:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/tools/ab.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ironfoundry-attic/ironfoundry/64abf00f733d363c8d0ac2248dd886f0775557a5/tools/ab.exe
--------------------------------------------------------------------------------
/tools/dea-monitor.rb:
--------------------------------------------------------------------------------
1 | require 'nats/client'
2 |
3 | def usage
4 | puts 'Usage: nats-monitor
5 | must start with nats://'
6 | exit
7 | end
8 |
9 | $nats_server = ARGV[0]
10 | if $nats_server.nil? or not $nats_server.start_with?('nats://')
11 | usage
12 | end
13 |
14 | ["TERM", "INT"].each { |sig| trap(sig) { NATS.stop } }
15 |
16 | def print_message(msg, reply, sub)
17 | puts "\n--------------------------------------------------\n\nSub '#{sub}' received message:\n#{msg}\nReply: #{reply}\n"
18 | end
19 |
20 | NATS.on_error { |err| puts "Server Error: #{err}"; exit! }
21 |
22 | NATS.start(:uri => $nats_server) do
23 | NATS.subscribe('dea.*') { |msg, reply, sub| print_message(msg, reply, sub) }
24 | NATS.subscribe('dea.*.start') { |msg, reply, sub| print_message(msg, reply, sub) }
25 | NATS.subscribe('droplet.*') { |msg, reply, sub| print_message(msg, reply, sub) }
26 | NATS.subscribe('router.*') { |msg, reply, sub| print_message(msg, reply, sub) }
27 | NATS.subscribe('healthmanager.*') { |msg, reply, sub| print_message(msg, reply, sub) }
28 | end
29 |
30 | NATS.stop
31 |
--------------------------------------------------------------------------------
/tools/iis_cleanup.ps1:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright [2011] [Tier 3 Inc.]
3 | # http://www.apache.org/licenses/LICENSE-2.0
4 | #
5 | # When run, will delete all Application Pools and Web Sites on the local machine.
6 | #
7 |
8 | $ErrorActionPreference = 'Stop'
9 | Set-StrictMode -Version 'Latest' -ErrorAction 'Stop' -Verbose
10 |
11 | $iisVersion = Get-ItemProperty "HKLM:\software\microsoft\InetStp"
12 | if ($iisVersion.MajorVersion -eq 7)
13 | {
14 | if ($iisVersion.MinorVersion -ge 5)
15 | {
16 | Import-Module WebAdministration
17 | }
18 | else
19 | {
20 | if (-not (Get-PSSnapIn | ? { $_.Name -eq "WebAdministration" }))
21 | {
22 | Add-PSSnapIn WebAdministration
23 | }
24 | }
25 | }
26 |
27 | Get-ChildItem IIS:\AppPools | %{ Stop-WebAppPool -Name $_.Name; }
28 | Get-ChildItem IIS:\Sites | %{ Stop-Website -Name $_.Name; Remove-Website -Name $_.Name }
29 | Get-ChildItem IIS:\AppPools | %{ Remove-WebAppPool -Name $_.Name }
30 |
--------------------------------------------------------------------------------
/tools/start-apps.rb:
--------------------------------------------------------------------------------
1 | require 'json'
2 |
3 | file = ARGV[0]
4 | unless not file.nil? and File.exists?(file)
5 | STDERR.puts("File '#{file}' does not exist.")
6 | exit 1
7 | end
8 |
9 | j = JSON.load(File.open(file, 'rb:bom|utf-8'))
10 |
11 | pids = []
12 |
13 | j.each do |user|
14 | email = user['email']
15 | apps = user['apps']
16 | unless apps.nil? or apps.empty?
17 | apps.each do |app|
18 | app_name = app['name']
19 | puts "STARTING user '#{email}' app '#{app_name}' ...\n\n"
20 | STDOUT.flush
21 | pid = Process.spawn("vmc -u #{email} start #{app_name}")
22 | pids << pid
23 | if pids.length >= 3
24 | Process.waitall()
25 | pids = []
26 | end
27 | end
28 | end
29 | end
30 |
--------------------------------------------------------------------------------
/tools/stop-apps.rb:
--------------------------------------------------------------------------------
1 | require 'json'
2 |
3 | file = ARGV[0]
4 | unless not file.nil? and File.exists?(file)
5 | STDERR.puts("File '#{file}' does not exist.")
6 | exit 1
7 | end
8 |
9 | j = JSON.load(File.open(file, 'rb:bom|utf-8'))
10 |
11 | pids = []
12 |
13 | j.each do |user|
14 | email = user['email']
15 | apps = user['apps']
16 | unless apps.nil? or apps.empty?
17 | apps.each do |app|
18 | app_name = app['name']
19 | puts "Stopping user '#{email}' app '#{app_name}' ...\n\n"
20 | STDOUT.flush
21 | pid = Process.spawn("vmc -u #{email} stop #{app_name}")
22 | pids << pid
23 | if pids.length >= 10
24 | Process.waitall()
25 | pids = []
26 | end
27 | end
28 | end
29 | end
30 |
--------------------------------------------------------------------------------