Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add client side encryption before Send files to S3 #464

Merged
merged 39 commits into from
Dec 19, 2023

Conversation

gawsoftpl
Copy link
Contributor

  1. I added client side encryption before send files to S3. Encryption is synchronize, and encrypt and decrypt files with streams.
  2. Update Readme and nx plugin config files.

Integrate encryption in aws-cache.ts
…and download file

- Can set encryption key by NX_CLOUD_ENCRYPTION_KEY or NXCACHE_AWS_ENCRYPTION_KEY
@gawsoftpl
Copy link
Contributor Author

@bojanbass Are you there?

Copy link

nx-cloud bot commented Dec 12, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit b574d16. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


⌛ The following targets are in progress

🟥 Failed Commands
nx-cloud record -- yarn nx format:check
✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@bojanbass
Copy link
Owner

@bojanbass Are you there?

Give me some time to review this. Thank you for the PR.

@gawsoftpl
Copy link
Contributor Author

I fix e2e tests and fix format with "yarn format" command

@gawsoftpl
Copy link
Contributor Author

gawsoftpl commented Dec 14, 2023

I think that I have fixed all issues in my pull request.

Copy link

nx-cloud bot commented Dec 16, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 0c48bb4. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 5 targets

Sent with 💌 from NxCloud.

nx.json Outdated Show resolved Hide resolved
@gawsoftpl
Copy link
Contributor Author

Fixed all issues, please check.

@bojanbass
Copy link
Owner

I think this is ready to be merged. Can we cleanup git commit history or we just squash this?

@gawsoftpl
Copy link
Contributor Author

squash this

@bojanbass bojanbass merged commit 142a754 into bojanbass:master Dec 19, 2023
7 checks passed
@bojanbass
Copy link
Owner

squash this

Thank you for contribution and having patience with comments :)

@gawsoftpl
Copy link
Contributor Author

Ok, but please read my last comment to your test:
#464 (comment)

@gawsoftpl
Copy link
Contributor Author

I can add integration tests

But how to provide a way to run it with the same command on both environments and be consistent with nx targets?

Without docker or docker-compose I cant run minio server in clean and fast way. Best way is create new target "test-integration" with executor nx:run-commands like:

packages/nx-aws-cache/project.json

    "test-integration": {
      "executor": "nx:run-commands",
      "options": {
        "commands": [
          "docker-compose up -d",
          "npx jest aws-cache.integration.spec.ts"
        ],
        "cwd": "packages/nx-aws-cache"
      },
      "configurations": {
        "ci": {
          "ci": true
        }
      }
    }

@bojanbass
Copy link
Owner

I can add integration tests

But how to provide a way to run it with the same command on both environments and be consistent with nx targets?

Without docker or docker-compose I cant run minio server in clean and fast way. Best way is create new target "test-integration" with executor nx:run-commands like:

packages/nx-aws-cache/project.json

    "test-integration": {
      "executor": "nx:run-commands",
      "options": {
        "commands": [
          "docker-compose up -d",
          "npx jest aws-cache.integration.spec.ts"
        ],
        "cwd": "packages/nx-aws-cache"
      },
      "configurations": {
        "ci": {
          "ci": true
        }
      }
    }

So you would like to run docker-compose inside GitHub actions? What is the best way to do it? In GitLab, I would use services for example, where I would run minio as a service using docker, and expose it to be able to use in tests. This seems to me like a prerequisite to run tests, before running NX target. I'm not event sure if running docker-compose as a target works ok, because probably it won't stop automatically after the tests are completed, or will it?

@gawsoftpl
Copy link
Contributor Author

So you would like to run docker-compose inside GitHub actions? What is the best way to do it? In GitLab, I would use services for example, where I would run minio as a service using docker, and expose it to be able to use in tests. This seems to me like a prerequisite to run tests, before running NX target. I'm not event sure if running docker-compose as a target works ok, because probably it won't stop automatically after the tests are completed, or will it?

Yes you are right. In gitlab best way to do it is use service to run minio. Equivalent in github will be prerequisite action. But there will be another issue how to run it with local dev tests?
Yes there is third requirement action to close docker-compose

The question is how to run additional service in nx pipeline in dev mode and in ci with one command?

All this gives the impression that nx is missing a plugin like @nx/service to run additional service for e2e tests to run service like in gitlab ci pipeline, which will run service and automatically close service. That service should run independent of system and should run in docker or podman.

It seems that there is a new idea for a plugin for nx

@bojanbass
Copy link
Owner

So you would like to run docker-compose inside GitHub actions? What is the best way to do it? In GitLab, I would use services for example, where I would run minio as a service using docker, and expose it to be able to use in tests. This seems to me like a prerequisite to run tests, before running NX target. I'm not event sure if running docker-compose as a target works ok, because probably it won't stop automatically after the tests are completed, or will it?

Yes you are right. In gitlab best way to do it is use service to run minio. Equivalent in github will be prerequisite action. But there will be another issue how to run it with local dev tests? Yes there is third requirement action to close docker-compose

The question is how to run additional service in nx pipeline in dev mode and in ci with one command?

All this gives the impression that nx is missing a plugin like @nx/service to run additional service for e2e tests to run service like in gitlab ci pipeline, which will run service and automatically close service. That service should run independent of system and should run in docker or podman.

It seems that there is a new idea for a plugin for nx

Yes, it's tricky. Maybe one idea is to make a custom executor which accepts buildTarget. This target could then run docker-compose locally (default configuration), but ci configuration wouldn't run it. Similar to something like this:

    "serve": {
      "executor": "@nx/js:node",
      "defaultConfiguration": "development",
      "configurations": {
        "development": {
          "buildTarget": "project:build:development"
        },
        "production": {
          "buildTarget": "project:build:production"
        }
      }
    },
    ```
Then, on CI, minio would already have to be running before executing targets. 

So, have you found out if it's possible ti run `docker-compose` down at the end of the tests?

@gawsoftpl
Copy link
Contributor Author

I have created new discussion in nx nrwl/nx#20903

@bojanbass
Copy link
Owner

I have created new discussion in nx nrwl/nx#20903

Perfect!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants