github.com/streamdal/segmentio-kafka-go@v0.4.47-streamdal/.circleci/config.yml (about)

     1  version: 2
     2  jobs:
     3    lint:
     4      docker:
     5        - image: golangci/golangci-lint:v1.45-alpine
     6      steps:
     7        - checkout
     8        - run: golangci-lint run
     9  
    10    # The kafka 0.10 tests are maintained as a separate configuration because
    11    # kafka only supported plain text SASL in this version.
    12    # NOTE: Bitnami does not have suport for kafka version 0.10.1.1. Hence we use 0.10.2.1
    13    kafka-010:
    14      working_directory: &working_directory /go/src/github.com/segmentio/kafka-go
    15      docker:
    16      - image: circleci/golang
    17      - image: bitnami/zookeeper:latest
    18        ports:
    19        - 2181:2181
    20        environment:
    21          ALLOW_ANONYMOUS_LOGIN: yes
    22      - image: bitnami/kafka:0.10.2.1
    23        ports:
    24        - 9092:9092
    25        - 9093:9093
    26        environment:
    27          KAFKA_BROKER_ID: 1
    28          KAFKA_DELETE_TOPIC_ENABLE: 'true'
    29          KAFKA_ADVERTISED_HOST_NAME: 'localhost'
    30          KAFKA_ADVERTISED_PORT: '9092'
    31          KAFKA_ZOOKEEPER_CONNECT: localhost:2181
    32          KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
    33          KAFKA_MESSAGE_MAX_BYTES: '200000000'
    34          KAFKA_LISTENERS: 'PLAINTEXT://:9092,SASL_PLAINTEXT://:9093'
    35          KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://localhost:9092,SASL_PLAINTEXT://localhost:9093'
    36          KAFKA_SASL_ENABLED_MECHANISMS: 'PLAIN,SCRAM-SHA-256,SCRAM-SHA-512'
    37          KAFKA_AUTHORIZER_CLASS_NAME: 'kafka.security.auth.SimpleAclAuthorizer'
    38          KAFKA_ALLOW_EVERYONE_IF_NO_ACL_FOUND: 'true'
    39          KAFKA_OPTS: "-Djava.security.auth.login.config=/opt/bitnami/kafka/config/kafka_server_jaas.conf"
    40          ALLOW_PLAINTEXT_LISTENER: yes
    41        entrypoint:
    42          - "/bin/bash"
    43          - "-c"
    44          - echo -e 'KafkaServer {\norg.apache.kafka.common.security.scram.ScramLoginModule required\n username="adminscram"\n password="admin-secret";\n org.apache.kafka.common.security.plain.PlainLoginModule required\n username="adminplain"\n password="admin-secret"\n user_adminplain="admin-secret";\n  };' > /opt/bitnami/kafka/config/kafka_server_jaas.conf; /opt/bitnami/kafka/bin/kafka-configs.sh --zookeeper localhost:2181 --alter --add-config 'SCRAM-SHA-256=[password=admin-secret-256],SCRAM-SHA-512=[password=admin-secret-512]' --entity-type users --entity-name adminscram; exec /app-entrypoint.sh /start-kafka.sh
    45  
    46      steps: &steps
    47      - checkout
    48      - restore_cache:
    49          key: kafka-go-mod-{{ checksum "go.sum" }}-1
    50      - run:
    51          name: Download dependencies
    52          command: go mod download
    53      - save_cache:
    54          key: kafka-go-mod-{{ checksum "go.sum" }}-1
    55          paths:
    56          - /go/pkg/mod
    57      - run:
    58          name: Test kafka-go
    59          command: go test -race -cover ./...
    60      - run:
    61          name: Test kafka-go unsafe
    62          command: go test -tags=unsafe -race -cover ./...
    63      - run:
    64          name: Test kafka-go/sasl/aws_msk_iam
    65          working_directory: ./sasl/aws_msk_iam
    66          command: go test -race -cover ./...
    67  
    68    kafka-011:
    69      working_directory: *working_directory
    70      environment:
    71        KAFKA_VERSION: "0.11.0"
    72      docker:
    73      - image: circleci/golang
    74      - image: bitnami/zookeeper:latest
    75        ports:
    76        - 2181:2181
    77        environment:
    78          ALLOW_ANONYMOUS_LOGIN: yes
    79      - image: bitnami/kafka:0.11.0-1-r1
    80        ports:
    81        - 9092:9092
    82        - 9093:9093
    83        environment:
    84          KAFKA_BROKER_ID: 1
    85          KAFKA_DELETE_TOPIC_ENABLE: 'true'
    86          KAFKA_ADVERTISED_HOST_NAME: 'localhost'
    87          KAFKA_ADVERTISED_PORT: '9092'
    88          KAFKA_ZOOKEEPER_CONNECT: localhost:2181
    89          KAFKA_LISTENERS: 'PLAINTEXT://:9092,SASL_PLAINTEXT://:9093'
    90          KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://localhost:9092,SASL_PLAINTEXT://localhost:9093'
    91          KAFKA_ALLOW_EVERYONE_IF_NO_ACL_FOUND: 'true'
    92          KAFKA_OPTS: "-Djava.security.auth.login.config=/opt/bitnami/kafka/config/kafka_server_jaas.conf"
    93          ALLOW_PLAINTEXT_LISTENER: "yes"
    94        entrypoint:
    95          - "/bin/bash"
    96          - "-c"
    97          # 0.11.0 image is not honoring some configs required in server.properties
    98          - echo -e '\nsasl.enabled.mechanisms=PLAIN,SCRAM-SHA-256,SCRAM-SHA-512\nmessage.max.bytes=200000000\nauto.create.topics.enable=true\nport=9092' >> /opt/bitnami/kafka/config/server.properties; echo -e 'KafkaServer {\norg.apache.kafka.common.security.scram.ScramLoginModule required\n username="adminscram"\n password="admin-secret";\n org.apache.kafka.common.security.plain.PlainLoginModule required\n username="adminplain"\n password="admin-secret"\n user_adminplain="admin-secret";\n  };' > /opt/bitnami/kafka/config/kafka_server_jaas.conf; /opt/bitnami/kafka/bin/kafka-configs.sh --zookeeper localhost:2181 --alter --add-config 'SCRAM-SHA-256=[password=admin-secret-256],SCRAM-SHA-512=[password=admin-secret-512]' --entity-type users --entity-name adminscram; exec /app-entrypoint.sh /run.sh
    99      steps: *steps
   100  
   101    kafka-231:
   102      working_directory: *working_directory
   103      environment:
   104        KAFKA_VERSION: "2.3.1"
   105      docker:
   106      - image: circleci/golang
   107      - image: bitnami/zookeeper:latest
   108        ports:
   109        - 2181:2181
   110        environment:
   111          ALLOW_ANONYMOUS_LOGIN: yes
   112      - image: bitnami/kafka:2.3.1-ol-7-r61
   113        ports:
   114        - 9092:9092
   115        - 9093:9093
   116        environment:
   117          KAFKA_CFG_BROKER_ID: 1
   118          KAFKA_CFG_DELETE_TOPIC_ENABLE: 'true'
   119          KAFKA_CFG_ADVERTISED_HOST_NAME: 'localhost'
   120          KAFKA_CFG_ADVERTISED_PORT: '9092'
   121          KAFKA_CFG_ZOOKEEPER_CONNECT: localhost:2181
   122          KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE: 'true'
   123          KAFKA_CFG_MESSAGE_MAX_BYTES: '200000000'
   124          KAFKA_CFG_LISTENERS: 'PLAINTEXT://:9092,SASL_PLAINTEXT://:9093'
   125          KAFKA_CFG_ADVERTISED_LISTENERS: 'PLAINTEXT://localhost:9092,SASL_PLAINTEXT://localhost:9093'
   126          KAFKA_CFG_SASL_ENABLED_MECHANISMS: 'PLAIN,SCRAM-SHA-256,SCRAM-SHA-512'
   127          KAFKA_CFG_AUTHORIZER_CLASS_NAME: 'kafka.security.auth.SimpleAclAuthorizer'
   128          KAFKA_CFG_ALLOW_EVERYONE_IF_NO_ACL_FOUND: 'true'
   129          KAFKA_INTER_BROKER_USER: adminplain
   130          KAFKA_INTER_BROKER_PASSWORD: admin-secret
   131          KAFKA_BROKER_USER: adminplain
   132          KAFKA_BROKER_PASSWORD: admin-secret
   133          ALLOW_PLAINTEXT_LISTENER: yes
   134        entrypoint:
   135          - "/bin/bash"
   136          - "-c"
   137          - /opt/bitnami/kafka/bin/kafka-configs.sh --zookeeper localhost:2181 --alter --add-config "SCRAM-SHA-256=[password=admin-secret-256],SCRAM-SHA-512=[password=admin-secret-512]" --entity-type users --entity-name adminscram; exec /entrypoint.sh /run.sh
   138      steps: *steps
   139  
   140    kafka-241:
   141      working_directory: *working_directory
   142      environment:
   143        KAFKA_VERSION: "2.4.1"
   144  
   145        # Need to skip nettest to avoid these kinds of errors:
   146        #  --- FAIL: TestConn/nettest (17.56s)
   147        #    --- FAIL: TestConn/nettest/PingPong (7.40s)
   148        #      conntest.go:112: unexpected Read error: [7] Request Timed Out: the request exceeded the user-specified time limit in the request
   149        #      conntest.go:118: mismatching value: got 77, want 78
   150        #      conntest.go:118: mismatching value: got 78, want 79
   151        # ...
   152        #
   153        # TODO: Figure out why these are happening and fix them (they don't appear to be new).
   154        KAFKA_SKIP_NETTEST: "1"
   155      docker:
   156      - image: circleci/golang
   157      - image: bitnami/zookeeper:latest
   158        ports:
   159        - 2181:2181
   160        environment:
   161          ALLOW_ANONYMOUS_LOGIN: yes
   162      - image: bitnami/kafka:2.4.1
   163        ports:
   164        - 9092:9092
   165        - 9093:9093
   166        environment: &environment
   167          KAFKA_CFG_BROKER_ID: 1
   168          KAFKA_CFG_DELETE_TOPIC_ENABLE: 'true'
   169          KAFKA_CFG_ADVERTISED_HOST_NAME: 'localhost'
   170          KAFKA_CFG_ADVERTISED_PORT: '9092'
   171          KAFKA_CFG_ZOOKEEPER_CONNECT: localhost:2181
   172          KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE: 'true'
   173          KAFKA_CFG_MESSAGE_MAX_BYTES: '200000000'
   174          KAFKA_CFG_LISTENERS: 'PLAINTEXT://:9092,SASL_PLAINTEXT://:9093'
   175          KAFKA_CFG_ADVERTISED_LISTENERS: 'PLAINTEXT://localhost:9092,SASL_PLAINTEXT://localhost:9093'
   176          KAFKA_CFG_SASL_ENABLED_MECHANISMS: 'PLAIN,SCRAM-SHA-256,SCRAM-SHA-512'
   177          KAFKA_CFG_AUTHORIZER_CLASS_NAME: 'kafka.security.auth.SimpleAclAuthorizer'
   178          KAFKA_CFG_ALLOW_EVERYONE_IF_NO_ACL_FOUND: 'true'
   179          KAFKA_OPTS: "-Djava.security.auth.login.config=/opt/bitnami/kafka/config/kafka_jaas.conf"
   180          ALLOW_PLAINTEXT_LISTENER: yes
   181        entrypoint: &entrypoint
   182          - "/bin/bash"
   183          - "-c"
   184          - echo -e 'KafkaServer {\norg.apache.kafka.common.security.scram.ScramLoginModule required\n username="adminscram"\n password="admin-secret";\n org.apache.kafka.common.security.plain.PlainLoginModule required\n username="adminplain"\n password="admin-secret"\n user_adminplain="admin-secret";\n  };' > /opt/bitnami/kafka/config/kafka_jaas.conf; /opt/bitnami/kafka/bin/kafka-configs.sh --zookeeper localhost:2181 --alter --add-config "SCRAM-SHA-256=[password=admin-secret-256],SCRAM-SHA-512=[password=admin-secret-512]" --entity-type users --entity-name adminscram; exec /entrypoint.sh /run.sh
   185      steps: *steps
   186  
   187    kafka-260:
   188      working_directory: *working_directory
   189      environment:
   190        KAFKA_VERSION: "2.6.0"
   191  
   192        # Need to skip nettest to avoid these kinds of errors:
   193        #  --- FAIL: TestConn/nettest (17.56s)
   194        #    --- FAIL: TestConn/nettest/PingPong (7.40s)
   195        #      conntest.go:112: unexpected Read error: [7] Request Timed Out: the request exceeded the user-specified time limit in the request
   196        #      conntest.go:118: mismatching value: got 77, want 78
   197        #      conntest.go:118: mismatching value: got 78, want 79
   198        # ...
   199        #
   200        # TODO: Figure out why these are happening and fix them (they don't appear to be new).
   201        KAFKA_SKIP_NETTEST: "1"
   202      docker:
   203      - image: circleci/golang
   204      - image: bitnami/zookeeper:latest
   205        ports:
   206        - 2181:2181
   207        environment:
   208          ALLOW_ANONYMOUS_LOGIN: yes
   209      - image: bitnami/kafka:2.6.0
   210        ports:
   211        - 9092:9092
   212        - 9093:9093
   213        environment: *environment
   214        entrypoint: *entrypoint
   215      steps: *steps
   216  
   217    # NOTE: Bitnami does not have suport for kafka version 2.7.1. Hence we use 2.7.0
   218    kafka-270:
   219      working_directory: *working_directory
   220      environment:
   221        KAFKA_VERSION: "2.7.0"
   222  
   223        # Need to skip nettest to avoid these kinds of errors:
   224        #  --- FAIL: TestConn/nettest (17.56s)
   225        #    --- FAIL: TestConn/nettest/PingPong (7.40s)
   226        #      conntest.go:112: unexpected Read error: [7] Request Timed Out: the request exceeded the user-specified time limit in the request
   227        #      conntest.go:118: mismatching value: got 77, want 78
   228        #      conntest.go:118: mismatching value: got 78, want 79
   229        # ...
   230        #
   231        # TODO: Figure out why these are happening and fix them (they don't appear to be new).
   232        KAFKA_SKIP_NETTEST: "1"
   233      docker:
   234      - image: circleci/golang
   235      - image: bitnami/zookeeper:latest
   236        ports:
   237        - 2181:2181
   238        environment:
   239          ALLOW_ANONYMOUS_LOGIN: yes
   240      - image: bitnami/kafka:2.7.0
   241        ports:
   242        - 9092:9092
   243        - 9093:9093
   244        environment: *environment
   245        entrypoint: *entrypoint
   246      steps: *steps
   247  
   248    kafka-281:
   249      working_directory: *working_directory
   250      environment:
   251        KAFKA_VERSION: "2.8.1"
   252  
   253        # Need to skip nettest to avoid these kinds of errors:
   254        #  --- FAIL: TestConn/nettest (17.56s)
   255        #    --- FAIL: TestConn/nettest/PingPong (7.40s)
   256        #      conntest.go:112: unexpected Read error: [7] Request Timed Out: the request exceeded the user-specified time limit in the request
   257        #      conntest.go:118: mismatching value: got 77, want 78
   258        #      conntest.go:118: mismatching value: got 78, want 79
   259        # ...
   260        #
   261        # TODO: Figure out why these are happening and fix them (they don't appear to be new).
   262        KAFKA_SKIP_NETTEST: "1"
   263      docker:
   264      - image: circleci/golang
   265      - image: bitnami/zookeeper:latest
   266        ports:
   267        - 2181:2181
   268        environment:
   269          ALLOW_ANONYMOUS_LOGIN: yes
   270      - image: bitnami/kafka:2.8.1
   271        ports:
   272        - 9092:9092
   273        - 9093:9093
   274        environment: *environment
   275        entrypoint: *entrypoint
   276      steps: *steps
   277  
   278  workflows:
   279    version: 2
   280    run:
   281      jobs:
   282      - lint
   283      - kafka-010
   284      - kafka-011
   285      # - kafka-101 # Bitnami image fails for SCRAM. refer kafka-do/docker_compose_versions/README.md 
   286      # - kafka-111 # Bitnami image fails for SCRAM. refer kafka-do/docker_compose_versions/README.md
   287      # - kafka-201 # Bitnami image fails for SCRAM. refer kafka-do/docker_compose_versions/README.md
   288      # - kafka-211 # Bitnami image fails for SCRAM. refer kafka-do/docker_compose_versions/README.md
   289      # - kafka-222 # Bitnami v222 not found. v221 Bitnami image fails for SCRAM. refer kafka-do/docker_compose_versions/README.md
   290      - kafka-231
   291      - kafka-241
   292      - kafka-260
   293      - kafka-270
   294      - kafka-281