Skip to content

Commit

Permalink
Merge pull request #9 from jsafrane/rebase-v1.1.6
Browse files Browse the repository at this point in the history
Bug 2047190: Rebase to v1.1.6
  • Loading branch information
openshift-merge-robot committed Jan 28, 2022
2 parents ac83e4b + 0972281 commit b9dd1ad
Show file tree
Hide file tree
Showing 1,077 changed files with 39,794 additions and 27,647 deletions.
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
@@ -0,0 +1,29 @@
---
name: Bug Report
about: Report a bug encountered while operating Kubernetes
labels: kind/bug

---

<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks!
If the matter is security related, please disclose it privately via https://kubernetes.io/security/
-->


#### What happened:

#### What you expected to happen:

#### How to reproduce it (as minimally and precisely as possible):

#### Anything else we need to know?:

#### Environment:
- Kubernetes version (use `kubectl version`):
- Cloud provider or hardware configuration:
- OS (e.g: `cat /etc/os-release`):
- Kernel (e.g. `uname -a`):
- Install tools:
- Network plugin and version (if this is a network-related bug):
- Others:
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/enhancement.md
@@ -0,0 +1,17 @@
---
name: Enhancement Tracking Issue
about: Provide supporting details for a feature in development
labels: kind/feature

---
<!-- Feature requests are unlikely to make progress as an issue.
Instead, please suggest enhancements by engaging with SIGs on slack and mailing lists.
A proposal that works through the design along with the implications of the change can be opened as a KEP:
https://git.k8s.io/enhancements/keps#kubernetes-enhancement-proposals-keps
-->

#### What would you like to be added:

#### Why is this needed:
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/failing-test.md
@@ -0,0 +1,20 @@
---
name: Failing Test
about: Report continuously failing tests or jobs in Kubernetes CI
labels: kind/failing-test

---

<!-- Please only use this template for submitting reports about continuously failing tests or jobs in Kubernetes CI -->

#### Which jobs are failing:

#### Which test(s) are failing:

#### Since when has it been failing:

#### Testgrid link:

#### Reason for failure:

#### Anything else we need to know:
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/flaking-test.md
@@ -0,0 +1,22 @@
---
name: Flaking Test
about: Report flaky tests or jobs in Kubernetes CI
labels: kind/flake

---

<!-- Please only use this template for submitting reports about flaky tests or jobs (pass or fail with no underlying change in code) in Kubernetes CI -->

#### Which jobs are flaking:

#### Which test(s) are flaking:

#### Testgrid link:

#### Reason for failure:

#### Anything else we need to know:
- links to go.k8s.io/triage appreciated
- links to specific failures in spyglass appreciated

<!-- Please see the deflaking doc (https://github.com/kubernetes/community/blob/master/contributors/devel/sig-testing/flaky-tests.md) for more guidance! -->
72 changes: 72 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,72 @@
<!-- Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://git.k8s.io/community/contributors/guide/first-contribution.md#your-first-contribution and developer guide https://git.k8s.io/community/contributors/devel/development.md#development-guide
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request. For reference on required PR/issue labels, read here:
https://git.k8s.io/community/contributors/devel/sig-release/release.md#issuepr-kind-label
3. Ensure you have added or ran the appropriate tests for your PR: https://git.k8s.io/community/contributors/devel/sig-testing/testing.md
4. If you want *faster* PR reviews, read how: https://git.k8s.io/community/contributors/guide/pull-requests.md#best-practices-for-faster-reviews
5. If the PR is unfinished, see how to mark it: https://git.k8s.io/community/contributors/guide/pull-requests.md#marking-unfinished-pull-requests
-->

#### What type of PR is this?

<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind design
Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->

#### What this PR does / why we need it:

#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
-->
Fixes #

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?
<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
For more information on release notes see: https://git.k8s.io/community/contributors/guide/release-notes.md
-->
```release-note
```

#### Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

<!--
This section can be blank if this pull request does not require a release note.
When adding links which point to resources within git repositories, like
KEPs or supporting documentation, please reference a specific commit and avoid
linking directly to the master branch. This ensures that links reference a
specific point in time, rather than a document that may change over time.
See here for guidance on getting permanent links to files: https://help.github.com/en/articles/getting-permanent-links-to-files
Please use the following format for linking documentation:
- [KEP]: <link>
- [Usage]: <link>
- [Other doc]: <link>
-->
```docs
```
9 changes: 0 additions & 9 deletions Makefile
Expand Up @@ -43,15 +43,6 @@ build:
./PHONY: build-amd
build-amd:
./build/build-all.sh "" $(REPONAME)
./build/build-all-arm.sh "" $(REPONAME)

./PHONY: build-amd
build-amd:
./build/build-all.sh "" $(REPONAME)

.PHONY: build-arm
build-arm:
./build/build-all-arm.sh "" $(REPONAME)

.PHONY: build-arm
build-arm:
Expand Down
7 changes: 4 additions & 3 deletions build/ack/Dockerfile
@@ -1,8 +1,8 @@
FROM registry.cn-hangzhou.aliyuncs.com/acs/centos:7-update
FROM registry.cn-hangzhou.aliyuncs.com/plugins/centos:7.9.2009
LABEL maintainers="Alibaba Cloud Authors"
LABEL description="Alibaba Cloud CSI Plugin"

RUN yum install -y ca-certificates file tzdata nfs-utils xfsprogs e4fsprogs pciutils iputils strace cloud-utils-growpart gdisk
RUN yum install -y ca-certificates file tzdata nfs-utils xfsprogs e4fsprogs pciutils iputils strace cloud-utils-growpart gdisk nc

ARG ossfsVer=1.80.6.ack.1
ARG update_ossfsVer=1.86.1.ack.1
Expand All @@ -11,11 +11,12 @@ RUN curl http://ack-csiplugin.oss-cn-hangzhou.aliyuncs.com/pre/ossfs/ossfs_${upd
RUN curl http://ack-csiplugin.oss-cn-hangzhou.aliyuncs.com/pre/ossfs/ossfs_${update_ossfsVer}-75ed4f1_centos8_x86_64.rpm -o /root/ossfs_1.86.4_centos8_x86_64.rpm

COPY nsenter /nsenter
COPY jindofs-fuse-3.7.3-20211207.tar.gz /jindofs-fuse-3.7.3-20211207.tar.gz
COPY entrypoint.sh /entrypoint.sh
COPY csiplugin-connector /bin/csiplugin-connector
COPY csiplugin-connector.service /bin/csiplugin-connector.service
COPY plugin.csi.alibabacloud.com /bin/plugin.csi.alibabacloud.com
RUN chmod +x /bin/plugin.csi.alibabacloud.com && chmod +x /entrypoint.sh && chmod +x /bin/csiplugin-connector && chmod +x /bin/csiplugin-connector.service
RUN chmod +x /bin/plugin.csi.alibabacloud.com && chmod +x /entrypoint.sh && chmod +x /bin/csiplugin-connector && chmod +x /bin/csiplugin-connector.service && tar zvxf /jindofs-fuse-3.7.3-20211207.tar.gz -C /

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone
Expand Down
63 changes: 56 additions & 7 deletions build/ack/entrypoint.sh
Expand Up @@ -19,6 +19,9 @@ if [[ "$os_release_exist" = "0" ]]; then
if [[ `echo ${osID} | grep "alinux" | wc -l` != "0" ]] && [[ "${osVersion}" ]]; then
host_os="alinux3"
fi
if [[ `echo ${osID} | grep "lifsea" | wc -l` != "0" ]]; then
host_os="lifsea"
fi
fi

## check which plugin is running
Expand Down Expand Up @@ -76,26 +79,67 @@ if [ "$run_oss" = "true" ]; then
ossfsArch="centos8"
fi

if [[ ${host_os} == "lifsea" ]]; then
ossfsArch="centos8"
fi

echo "Starting deploy oss csi-plugin..."
echo "osHost:"${host_os}
echo "ossfsVersion:"${ossfsVer}
echo "ossfsArch:"${ossfsArch}

# install OSSFS
mkdir -p /host/etc/csi-tool/
reconcileOssFS="skip"
if [ ! `/nsenter --mount=/proc/1/ns/mnt which ossfs` ]; then
echo "First install ossfs, ossfsVersion: $ossfsVer"
cp /root/ossfs_${ossfsVer}_${ossfsArch}_x86_64.rpm /host/etc/csi-tool/
/nsenter --mount=/proc/1/ns/mnt yum localinstall -y /etc/csi-tool/ossfs_${ossfsVer}_${ossfsArch}_x86_64.rpm
reconcileOssFS="install"
# update OSSFS
else
echo "Check ossfs Version...."
oss_info=`/nsenter --mount=/proc/1/ns/mnt ossfs --version | grep -E -o "V[0-9.a-z]+" | cut -d"V" -f2`
if [ "$oss_info" != "$ossfsVer" ]; then
echo "Upgrade ossfs, ossfsVersion: $ossfsVer"
/nsenter --mount=/proc/1/ns/mnt yum remove -y ossfs
cp /root/ossfs_${ossfsVer}_${ossfsArch}_x86_64.rpm /host/etc/csi-tool/
/nsenter --mount=/proc/1/ns/mnt yum localinstall -y /etc/csi-tool/ossfs_${ossfsVer}_${ossfsArch}_x86_64.rpm
reconcileOssFS="upgrade"
fi
fi

if [[ ${reconcileOssFS} == "install" ]]; then
if [[ ${host_os} == "lifsea" ]]; then
rpm2cpio /root/ossfs_${ossfsVer}_${ossfsArch}_x86_64.rpm | cpio -idmv
cp ./usr/local/bin/ossfs /host/etc/csi-tool/
/nsenter --mount=/proc/1/ns/mnt cp /etc/csi-tool/ossfs /usr/local/bin/ossfs
else
/nsenter --mount=/proc/1/ns/mnt yum localinstall -y /etc/csi-tool/ossfs_${ossfsVer}_${ossfsArch}_x86_64.rpm
fi
fi

if [[ ${reconcileOssFS} == "upgrade" ]]; then
if [[ ${host_os} == "lifsea" ]]; then
/nsenter --mount=/proc/1/ns/mnt rm /usr/local/bin/ossfs
rpm2cpio /root/ossfs_${ossfsVer}_${ossfsArch}_x86_64.rpm | cpio -idmv
cp ./usr/local/bin/ossfs /host/etc/csi-tool/
/nsenter --mount=/proc/1/ns/mnt cp /etc/csi-tool/ossfs /usr/local/bin/ossfs
else
/nsenter --mount=/proc/1/ns/mnt yum remove -y ossfs
/nsenter --mount=/proc/1/ns/mnt yum localinstall -y /etc/csi-tool/ossfs_${ossfsVer}_${ossfsArch}_x86_64.rpm
fi
fi

# install Jindofs
if [ ! -f "/host/etc/jindofs-tool/jindofs-fuse" ];then
mkdir -p /host/etc/jindofs-tool/
cp /jindofs-fuse /host/etc/jindofs-tool/jindofs-fuse
echo "install jindofs..."
else
oldmd5=`md5sum /host/etc/jindofs-tool/jindofs-fuse | awk '{print $1}'`
newmd5=`md5sum /jindofs-fuse | awk '{print $1}'`
if [ "$oldmd5" != "$newmd5" ]; then
rm -rf /host/etc/jindofs-tool/jindofs-fuse
cp /jindofs-fuse /host/etc/jindofs-tool/jindofs-fuse
echo "upgrade jindofs..."
fi
fi

Expand Down Expand Up @@ -126,26 +170,31 @@ if [ "$run_oss" = "true" ]; then

# install/update csiplugin connector service
updateConnectorService="true"
systemdDir="/host/usr/lib/systemd/system"
if [[ ${host_os} == "lifsea" ]]; then
systemdDir="/host/etc/systemd/system"
fi

if [[ ! -z "${PLUGINS_SOCKETS}" ]];then
sed -i 's/Restart=always/Restart=on-failure/g' /bin/csiplugin-connector.service
sed -i '/^\[Service\]/a Environment=\"WATCHDOG_SOCKETS_PATH='"${PLUGINS_SOCKETS}"'\"' /bin/csiplugin-connector.service
sed -i '/ExecStop=\/bin\/kill -s QUIT $MAINPID/d' /bin/csiplugin-connector.service
sed -i '/^\[Service\]/a ExecStop=sh -xc "if [ x$MAINPID != x ]; then /bin/kill -s QUIT $MAINPID; fi"' /bin/csiplugin-connector.service
fi
if [ -f "/host/usr/lib/systemd/system/csiplugin-connector.service" ];then
if [ -f "$systemdDir/csiplugin-connector.service" ];then
echo "Check csiplugin-connector.service...."
oldmd5=`md5sum /host/usr/lib/systemd/system/csiplugin-connector.service | awk '{print $1}'`
oldmd5=`md5sum $systemdDir/csiplugin-connector.service | awk '{print $1}'`
newmd5=`md5sum /bin/csiplugin-connector.service | awk '{print $1}'`
if [ "$oldmd5" = "$newmd5" ]; then
updateConnectorService="false"
else
rm -rf /host/usr/lib/systemd/system/csiplugin-connector.service
rm -rf $systemdDir/csiplugin-connector.service
fi
fi

if [ "$updateConnectorService" = "true" ]; then
echo "Install csiplugin connector service...."
cp /bin/csiplugin-connector.service /host/usr/lib/systemd/system/csiplugin-connector.service
cp /bin/csiplugin-connector.service $systemdDir/csiplugin-connector.service
/nsenter --mount=/proc/1/ns/mnt systemctl daemon-reload
fi

Expand Down
3 changes: 2 additions & 1 deletion build/build-all.sh
Expand Up @@ -14,6 +14,7 @@ rm -rf build/ack/csiplugin-connector.go build/ack/csiplugin-connector-svc build/
cp build/oss/csiplugin-connector.go build/ack/csiplugin-connector.go
cp build/oss/csiplugin-connector.service build/ack/csiplugin-connector.service
cp build/oss/nsenter build/ack/nsenter
#cp build/oss/jindofs-fuse build/ack/jindofs-fuse

export GOARCH="amd64"
export GOOS="linux"
Expand All @@ -31,7 +32,7 @@ CGO_ENABLED=0 go build csiplugin-connector.go
if [ "$1" == "" ]; then
mv ${GOPATH}/src/github.com/$REPO_NAME/alibaba-cloud-csi-driver/plugin.csi.alibabacloud.com ./
docker build -t=registry.cn-hangzhou.aliyuncs.com/acs/csi-plugin:$VERSION-$GIT_HASH ./
rm -rf csiplugin-connector.go csiplugin-connector.service csiplugin-connector plugin.csi.alibabacloud.com ossfs_1.80.6_centos7.0_x86_64.rpm nsenter
rm -rf csiplugin-connector.go csiplugin-connector.service csiplugin-connector plugin.csi.alibabacloud.com ossfs_1.80.6_centos7.0_x86_64.rpm nsenter jindofs-fuse
docker push registry.cn-hangzhou.aliyuncs.com/acs/csi-plugin:$VERSION-$GIT_HASH
fi

4 changes: 2 additions & 2 deletions build/cpfs/entrypoint.sh
Expand Up @@ -55,8 +55,8 @@ elif [ "$os_release_exist" = "0" ]; then
fi

# cpfs version
dkmsversion="1.0.0-204"
cpfsversion="2.10.8-202"
dkmsversion="1.0.0-210a"
cpfsversion="2.10.8-205a"

if [ "$host_os" = "centos-7" ] || [ "$host_os" = "alios" ] ; then
if [ "${CPFS_VERSION}" != "" ]; then
Expand Down
2 changes: 1 addition & 1 deletion build/disk/Dockerfile
Expand Up @@ -2,7 +2,7 @@ FROM centos:7.4.1708
LABEL maintainers="Alibaba Cloud Authors"
LABEL description="Alibaba Cloud CSI Plugin"

RUN yum install -y ca-certificates file tzdata nfs-utils xfsprogs e4fsprogs
RUN yum install -y ca-certificates file tzdata nfs-utils xfsprogs e4fsprogs nc pciutils

COPY plugin.csi.alibabacloud.com /bin/plugin.csi.alibabacloud.com
RUN chmod +x /bin/plugin.csi.alibabacloud.com
Expand Down
3 changes: 2 additions & 1 deletion build/local/Dockerfile
@@ -1,4 +1,5 @@
FROM ubuntu:18.10
FROM ubuntu:20.04

LABEL maintainers="Alibaba Cloud Authors"
LABEL description="Alibaba Cloud CSI Plugin"

Expand Down

0 comments on commit b9dd1ad

Please sign in to comment.