Skip to content

Commit d5f76f7

Browse files
saiarcot895yxieca
authored andcommitted
Move sonic-host-services-data from sonic-buildimage into this repo
This repo's tests depends on files that are in src/sonic-host-services-data in sonic-buildimage. Due to PR check requirements, this creates a cyclical dependency when needing to update the templates and the sample output files. To fix that cyclical dependency, move that directory into this repo. That way, both the templates and the sample output files can be updated in a single commit. Signed-off-by: Saikrishna Arcot <[email protected]>
1 parent 4d0b030 commit d5f76f7

34 files changed

+567
-34
lines changed

azure-pipelines.yml

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@ trigger:
77
- master
88
- 202???
99

10-
resources:
11-
repositories:
12-
- repository: sonic-buildimage
13-
type: github
14-
name: sonic-net/sonic-buildimage
15-
endpoint: build
16-
1710
variables:
1811
- name: BUILD_BRANCH
1912
${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
@@ -30,7 +23,6 @@ stages:
3023
variables:
3124
DIFF_COVER_CHECK_THRESHOLD: 80
3225
DIFF_COVER_ENABLE: 'true'
33-
DIFF_COVER_WORKING_DIRECTORY: $(System.DefaultWorkingDirectory)/sonic-host-services
3426
pool:
3527
vmImage: ubuntu-20.04
3628

@@ -42,16 +34,6 @@ stages:
4234
clean: true
4335
submodules: recursive
4436
displayName: 'Checkout code'
45-
46-
- checkout: sonic-buildimage
47-
clean: true
48-
displayName: 'Checkout code'
49-
50-
- task: CopyFiles@2
51-
inputs:
52-
SourceFolder: '$(System.DefaultWorkingDirectory)/sonic-buildimage/src/sonic-host-services-data/'
53-
contents: '**'
54-
targetFolder: $(System.DefaultWorkingDirectory)/sonic-host-services-data/
5537

5638
- task: DownloadPipelineArtifact@2
5739
inputs:
@@ -102,14 +84,12 @@ stages:
10284
displayName: "Install .NET CORE"
10385
10486
- script: |
105-
pushd sonic-host-services
106-
10787
python3 setup.py test
10888
displayName: 'Test Python 3'
10989
11090
- task: PublishTestResults@2
11191
inputs:
112-
testResultsFiles: '$(System.DefaultWorkingDirectory)/sonic-host-services/test-results.xml'
92+
testResultsFiles: '$(System.DefaultWorkingDirectory)/test-results.xml'
11393
testRunTitle: Python 3
11494
failTaskOnFailedTests: true
11595
condition: succeededOrFailed()
@@ -118,17 +98,16 @@ stages:
11898
- task: PublishCodeCoverageResults@1
11999
inputs:
120100
codeCoverageTool: Cobertura
121-
summaryFileLocation: '$(System.DefaultWorkingDirectory)/sonic-host-services/coverage.xml'
122-
reportDirectory: '$(System.DefaultWorkingDirectory)/sonic-host-services/htmlcov/'
101+
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage.xml'
102+
reportDirectory: '$(System.DefaultWorkingDirectory)/htmlcov/'
123103
displayName: 'Publish Python 3 test coverage'
124104

125105
- script: |
126106
set -e
127-
pushd sonic-host-services
128107
python3 setup.py bdist_wheel
129108
displayName: 'Build Python 3 wheel'
130109
131-
- publish: '$(System.DefaultWorkingDirectory)/sonic-host-services/dist/'
110+
- publish: '$(System.DefaultWorkingDirectory)/dist/'
132111
artifact: wheels
133112
displayName: "Publish Python wheels"
134113

data/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
debian/*.debhelper
2+
debian/debhelper-build-stamp
3+
debian/sonic-host-services-data/
4+
sonic-host-services-data_*.buildinfo
5+
sonic-host-services-data_*.changes
6+
sonic-host-services-data_*.deb

data/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# sonic-host-services-data
2+
Data files required for SONiC host services
3+
4+
5+
## To build
6+
7+
```
8+
dpkg-buildpackage -rfakeroot -b -us -uc
9+
```
10+
11+
## To clean
12+
13+
```
14+
dpkg-buildpackage -rfakeroot -Tclean
15+
```
16+
17+
---
18+
19+
See the [SONiC Website](https://sonicfoundation.dev/) for more information about the SONiC project.

data/debian/changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
sonic-host-services-data (1.0-1) UNRELEASED; urgency=low
2+
3+
* Initial release
4+
5+
-- Joe LeVeque <[email protected]> Tue, 20 Oct 2020 02:35:43 +0000

data/debian/compat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
11

data/debian/control

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Source: sonic-host-services-data
2+
Maintainer: Joe LeVeque <[email protected]>
3+
Section: misc
4+
Priority: optional
5+
Standards-Version: 0.1
6+
Build-Depends: debhelper (>=11)
7+
8+
Package: sonic-host-services-data
9+
Architecture: all
10+
Depends: ${misc:Depends}
11+
Description: Data files required for SONiC host services

data/debian/copyright

Whitespace-only changes.

data/debian/install

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
templates/*.j2 /usr/share/sonic/templates/
2+
org.sonic.hostservice.conf /etc/dbus-1/system.d

data/debian/rules

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/make -f
2+
3+
ifeq (${ENABLE_HOST_SERVICE_ON_START}, y)
4+
HOST_SERVICE_OPTS := --no-start
5+
else
6+
HOST_SERVICE_OPTS := --no-start --no-enable
7+
endif
8+
9+
10+
build:
11+
12+
%:
13+
dh $@
14+
15+
override_dh_installsystemd:
16+
dh_installsystemd --no-start --name=caclmgrd
17+
dh_installsystemd --no-start --name=hostcfgd
18+
dh_installsystemd --no-start --name=featured
19+
dh_installsystemd --no-start --name=aaastatsd
20+
dh_installsystemd --no-start --name=procdockerstatsd
21+
dh_installsystemd --no-start --name=determine-reboot-cause
22+
dh_installsystemd --no-start --name=process-reboot-cause
23+
dh_installsystemd $(HOST_SERVICE_OPTS) --name=sonic-hostservice
24+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[Unit]
2+
Description=AAA Statistics Collection daemon
3+
Requires=hostcfgd.service
4+
After=hostcfgd.service updategraph.service
5+
BindsTo=sonic.target
6+
After=sonic.target
7+
8+
[Service]
9+
Type=simple
10+
ExecStart=/usr/local/bin/aaastatsd
11+
Restart=on-failure
12+
RestartSec=10
13+
TimeoutStopSec=3
14+

0 commit comments

Comments
 (0)