diff --git a/.dockerignore b/.dockerignore index a103066f4b..a04899ea1a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -20,3 +20,6 @@ Composer/packages/server/.composer extensions/.build-cache.json extensions/**/lib extensions/**/dist + +# ignore git folder +**/.git diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6f818ca078..0ba7296e2a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -9,37 +9,25 @@ on: jobs: build: - timeout-minutes: 60 + timeout-minutes: 120 runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- + - name: Build - uses: docker/build-push-action@v2 - with: - push: false - context: . - file: Dockerfile - tags: botframework-composer - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - load: true + run: docker build --tag botframework-composer --file Dockerfile . + - name: Health check run: | - docker run -d --rm -p "5000:5000" botframework-composer - sleep 10 + docker run -d -p 5000:5000 --name bfc botframework-composer + sleep 15 + docker ps -a + docker logs bfc curl -Is http://localhost:5000 | grep -q "200 OK" shell: bash + - name: Clean up if: always() - run: docker stop $(docker ps -a -q) + run: docker rm -f $(docker ps -a -q) diff --git a/Composer/packages/tools/language-servers/intellisense/src/resolvers/variableScopes.ts b/Composer/packages/tools/language-servers/intellisense/src/resolvers/variableScopes.ts index aa0cbc07f4..e0d7d44e37 100644 --- a/Composer/packages/tools/language-servers/intellisense/src/resolvers/variableScopes.ts +++ b/Composer/packages/tools/language-servers/intellisense/src/resolvers/variableScopes.ts @@ -32,5 +32,19 @@ export const variableScopesResolver = (): CompletionItem[] => { documentation: 'turn is associated with a single turn. You can also think of this as the bot handling a single message from the user. Properties in the turn scope are discarded at the end of the turn.', }, + { + label: 'this.', + kind: CompletionItemKind.Enum, + insertText: 'this.', + documentation: + "this is associated with the active action's properties. It is helpful for input actions that last beyond a single turn of the conversation. Two properties already on the scope are this.value and this.turnCount.", + }, + { + label: 'settings.', + kind: CompletionItemKind.Enum, + insertText: 'settings.', + documentation: + 'settings is associated with any information that is made available to the bot via the platform specific settings configuration system, for example if you are developing your bot using C#, these settings will appear in the appsettings.json file.', + }, ]; }; diff --git a/Dockerfile b/Dockerfile index 4bde95df41..c7e394fcdf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,9 +6,14 @@ # before doing yarn install due to yarn workspace symlinking. # ################ - -FROM node:12-buster as build - +FROM mcr.microsoft.com/dotnet/core/sdk:3.1-focal as base +RUN apt update \ + && apt -y install curl dirmngr apt-transport-https lsb-release ca-certificates \ + && curl -sL https://deb.nodesource.com/setup_12.x | bash - \ + && apt install -y nodejs \ + && npm install -g yarn + +FROM base as build ARG YARN_ARGS WORKDIR /src/Composer @@ -21,7 +26,7 @@ ENV NODE_ENV "production" ENV COMPOSER_BUILTIN_EXTENSIONS_DIR "/src/extensions" RUN yarn build:prod $YARN_ARGS -FROM node:12-buster as composerbasic +FROM base as composerbasic ARG YARN_ARGS WORKDIR /app/Composer @@ -32,56 +37,16 @@ COPY --from=build /src/extensions ../extensions ENV NODE_ENV "production" RUN yarn --production --frozen-lockfile --force $YARN_ARGS && yarn cache clean -WORKDIR /app/Composer - -FROM composerbasic - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - libc6 \ - libgcc1 \ - libgssapi-krb5-2 \ - libssl1.1 \ - libstdc++6 \ - zlib1g \ - && rm -rf /var/lib/apt/lists/* -# Install .Net Core SDK -ENV \ - # Unset the value from the base image - ASPNETCORE_URLS= \ - # Disable the invariant mode (set in base image) - DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \ - # Enable correct mode for dotnet watch (only mode supported in a container) - DOTNET_USE_POLLING_FILE_WATCHER=true \ - LC_ALL=en_US.UTF-8 \ - LANG=en_US.UTF-8 \ - # Skip extraction of XML docs - generally not useful within an image/container - helps performance - NUGET_XMLDOC_MODE=skip \ - # PowerShell telemetry for docker image usage - POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-DotnetCoreSDK-Ubuntu-18.04 - -# Add dependencies for disabling invariant mode (set in base image) -RUN wget http://mirrors.kernel.org/ubuntu/pool/main/i/icu/libicu60_60.2-3ubuntu3_amd64.deb -RUN dpkg -i libicu60_60.2-3ubuntu3_amd64.deb - -# Install .NET Core SDK 3.1 -ENV DOTNET_SDK_VERSION 3.1.403 +FROM base +ENV NODE_ENV "production" -RUN wget -O dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz \ - && dotnet_sha512='0a0319ee8e9042bf04b6e83211c2d6e44e40e604bff0a133ba0d246d08bff76ebd88918ab5e10e6f7f0d2b504ddeb65c0108c6539bc4fbc4f09e4af3937e88ea' \ - && echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \ - && mkdir -p /usr/share/dotnet \ - && tar -C /usr/share/dotnet -oxzf dotnet.tar.gz \ - && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \ - && rm dotnet.tar.gz +WORKDIR /app/Composer +COPY --from=composerbasic /app .. -# Enable detection of running in a container -ENV DOTNET_RUNNING_IN_CONTAINER=true \ - # Set the invariant mode since icu_libs isn't included (see https://github.com/dotnet/announcements/issues/20) - DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true ENV COMPOSER_BUILTIN_EXTENSIONS_DIR "/app/extensions" ENV COMPOSER_REMOTE_EXTENSIONS_DIR "/app/remote-extensions" ENV COMPOSER_EXTENSION_DATA "/app/extensions.json" -CMD ["yarn","start:server"] + +CMD ["yarn","start:server"] \ No newline at end of file