kubesphere / devops-agent

Agents for Kubesphere DevOps
Apache License 2.0
64 stars 76 forks source link

dotnet 5 support #24

Closed Dishone closed 3 years ago

Dishone commented 3 years ago

add dotnet 5 support

Dishone commented 3 years ago

okay, I'm modifying it

Dishone commented 3 years ago

excuse me? I need to add my document to website?

LinuxSuRen commented 3 years ago

excuse me? I need to add my document to website?

I don't understand the meaning of my document. Do you have a link or something that I can see?

What I mentioned before is that please add an item to the table. Please see the screenshot from the README file.

image

LinuxSuRen commented 3 years ago

Currently, we're using GitHub action to build the images. Of course, you can keep Jenkinsfile exist. It's pretty easy, please see also here. Copy and paste a new job, modify a few places.

By the way, please check the dco errors. In a short, you always need to add an option when you try to commit: -s.

For example, the correct git commit command is: git commit -s -m 'here is the message'.

You can do it by the following steps:

LinuxSuRen commented 3 years ago

hi @Dishone , as I mentioned before. I am not an expert on donet. If you could provide an open-source donet project, so I can help to test the image.

Dishone commented 3 years ago

hi @Dishone , as I mentioned before. I am not an expert on donet. If you could provide an open-source donet project, so I can help to test the image.

I'm working on the description. Please give me a little more time

LinuxSuRen commented 3 years ago

I'm working on the description. Please give me a little more time

Hi @Dishone , is there anything I can help with it?

Dishone commented 3 years ago

I think it only needs to provide dotnet-sdk-3.1 and dotnet-sdk-5


In dotnet/Dockerfilehttps://github.com/kubesphere/devops-agent/pull/24#discussion_r654197113:

@@ -0,0 +1,11 @@ +FROM kubespheredev/builder-base:v3.1.0 + +RUN rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm + +RUN yum install -y dotnet-sdk-5.0

In my view, 3.35G is too big. I have a question about the version. There's many version for SDK, but I guess not all of them are popular for users. For example, Java8 and Java11 are very popular for Java developers. So, we might don't need to provide all the version.

― You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/kubesphere/devops-agent/pull/24#discussion_r654197113, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMBYZ7GNBEUVSBCCUAXHPDLTTLXCNANCNFSM45T7NY6A.

LinuxSuRen commented 3 years ago

Any updates?

Dishone commented 3 years ago

In fact I have been using this image to build dotnet application

LinuxSuRen commented 3 years ago

In fact I have been using this image to build dotnet application

I believe it's true. But I need to verify it by myself if I want to merge this PR.

Dishone commented 3 years ago

First, you need to add some configuration files to jenkins-casc-config

- name: "dotnetcore"
  namespace: "kubesphere-devops-system"
  label: "dotnetcore"
  nodeUsageMode: "EXCLUSIVE"
  idleMinutes: 0
  containers:
  - name: "dotnetcore"
    image: "registry.cn-beijing.aliyuncs.com/kubesphereio/builder-dotnet:v3.1.0" #  Replace with your mirror address
    command: "cat"
    args: ""
    ttyEnabled: true
    resourceRequestCpu: "100m"
    resourceLimitCpu: "4000m"
    resourceRequestMemory: "100Mi"
    resourceLimitMemory: "8192Mi"
    alwaysPullImage: true
  - name: "jnlp"
    image: "jenkins/jnlp-slave:3.27-1"
    command: "jenkins-slave"
    args: "^${computer.jnlpmac} ^${computer.name}"
    resourceRequestCpu: "50m"
    resourceRequestMemory: "400Mi"
    resourceLimitMemory: "1536Mi"
  workspaceVolume:
    emptyDirWorkspaceVolume:
      memory: false
  volumes:
  - hostPathVolume:
      hostPath: "/var/run/docker.sock"
      mountPath: "/var/run/docker.sock"
  - hostPathVolume:
      hostPath: "jenkins_nuget_cache"
      mountPath: "/root/.nuget"
  - hostPathVolume:
      hostPath: "sonar_cache"
      mountPath: "/root/.sonar/cache"
  yamls:                                     
  - "spec:\r\n  affinity:\r\n    nodeAffinity:\r\n      preferredDuringSchedulingIgnoredDuringExecution:\r\n      - weight: 1\r\n        preference:\r\n          matchExpressions:\r\n          - key: node-role.kubernetes.io/worker\r\n            operator: In\r\n            values:\r\n            - ci\r\n  tolerations:\r\n  - key: \"node.kubernetes.io/ci\"\r\n    operator: \"Exists\"\r\n    effect: \"NoSchedule\"\r\n  - key: \"node.kubernetes.io/ci\"\r\n    operator: \"Exists\"\r\n    effect: \"PreferNoSchedule\"\r\n  containers:\r\n  - name: \"dotnetcore\"\r\n    resources:\r\n      requests:\r\n        ephemeral-storage: \"1Gi\"\r\n      limits:\r\n        ephemeral-storage: \"10Gi\"\r\n      securityContext:\r\n    fsGroup: 1000\r\n "

use this Sample Jenkins and dockerfile of this code have been verified by me and can be successfully built

LinuxSuRen commented 3 years ago

hi @Dishone, I'm wondering if it's ok for you to transfer the donet sample project to https://github.com/kubesphere-sigs/.

ks-ci-bot commented 3 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Dishone, LinuxSuRen

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubesphere/devops-agent/blob/master/OWNERS)~~ [LinuxSuRen] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
LinuxSuRen commented 3 years ago

/cc @kubesphere/sig-devops

Dishone commented 3 years ago

hi @Dishone, I'm wondering if it's ok for you to transfer the donet sample project to https://github.com/kubesphere-sigs/.

ok

LinuxSuRen commented 3 years ago

ping @JohnNiang

JohnNiang commented 3 years ago

I'm testing dotnet5 according to https://github.com/dotnet/dotnet-docker/blob/main/samples/run-tests-in-sdk-container.md#running-tests.

JohnNiang commented 3 years ago

LGTM

myokok commented 2 years ago

我现在就在kubesphere里创建流水线运行.netcore5项目。其实很简单,只要使用 dockerfile,将源码构建编译就可以了。

myokok commented 2 years ago

不需要修改kubesphere的其他的配置。

ivanmissu commented 2 years ago

@myokok .netcore3.1可以吗

myokok commented 2 years ago

@myokok .netcore3.1可以吗

可以的。操作起来很简单。